From f0de24c8e3977e1894c82e8ddf5131ba82bdf3ff Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Thu, 16 Sep 2010 09:08:15 +0000 Subject: [PATCH] explicitly set redelivery policy to ensure no default 1 sec delay, speed up test git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@997647 13f79535-47bb-0310-9956-ffa450edef68 --- .../RollbacksWhileConsumingLargeQueueTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java index e7ee17ee32..03a44e2618 100644 --- a/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/test/rollback/RollbacksWhileConsumingLargeQueueTest.java @@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import javax.jms.Connection; +import javax.jms.ConnectionFactory; import javax.jms.JMSException; import javax.jms.Message; import javax.jms.MessageConsumer; @@ -28,7 +29,9 @@ import javax.jms.MessageListener; import javax.jms.Session; import javax.jms.TextMessage; +import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.EmbeddedBrokerTestSupport; +import org.apache.activemq.RedeliveryPolicy; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.jms.core.MessageCreator; @@ -100,6 +103,17 @@ public class RollbacksWhileConsumingLargeQueueTest extends EmbeddedBrokerTestSup fail("Did not receive all the messages."); } + protected ConnectionFactory createConnectionFactory() throws Exception { + ActiveMQConnectionFactory answer = (ActiveMQConnectionFactory) super.createConnectionFactory(); + RedeliveryPolicy policy = new RedeliveryPolicy(); + policy.setMaximumRedeliveries(3); + policy.setRedeliveryDelay(0); + policy.setInitialRedeliveryDelay(0); + policy.setUseExponentialBackOff(false); + answer.setRedeliveryPolicy(policy); + return answer; + } + protected void setUp() throws Exception { super.setUp();