Author: jstrachan
Date: Wed May 23 03:18:20 2007
New Revision: 540916
URL: http://svn.apache.org/viewvc?view=rev&rev=540916
Log:
added test case to try reproduce AMQ-1152 (but unfortunately couldn't)
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
Modified:
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
URL:
http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java?view=diff&rev=540916&r1=540915&r2=540916
==============================================================================
---
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
(original)
+++
activemq/trunk/activemq-core/src/test/java/org/apache/activemq/ActiveMQConnectionFactoryTest.java
Wed May 23 03:18:20 2007
@@ -26,6 +26,8 @@
import javax.jms.Connection;
import javax.jms.JMSException;
+import javax.jms.Session;
+import javax.jms.MessageConsumer;
import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.broker.BrokerRegistry;
@@ -67,6 +69,19 @@
assertTrue(cf.isUseAsyncSend());
// the broker url have been adjusted.
assertEquals("vm:(broker:()/localhost)", cf.getBrokerURL());
+ }
+
+ public void testUseURIToConfigureRedeliveryPolicy() throws
URISyntaxException, JMSException {
+ ActiveMQConnectionFactory cf = new
ActiveMQConnectionFactory("vm://localhost?jms.redeliveryPolicy.maximumRedeliveries=2");
+ assertEquals("connection redeliveries", 2,
cf.getRedeliveryPolicy().getMaximumRedeliveries());
+
+ ActiveMQConnection connection = (ActiveMQConnection)
cf.createConnection();
+ assertEquals("connection redeliveries", 2,
connection.getRedeliveryPolicy().getMaximumRedeliveries());
+
+ Session session = connection.createSession(false,
Session.AUTO_ACKNOWLEDGE);
+ ActiveMQMessageConsumer consumer = (ActiveMQMessageConsumer)
session.createConsumer(session.createQueue("FOO.BAR"));
+ assertEquals("consumer redeliveries", 2,
consumer.getRedeliveryPolicy().getMaximumRedeliveries());
+ connection.close();
}
public void testCreateVMConnectionWithEmbdeddBroker() throws
URISyntaxException, JMSException {