activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: Test needs more wait time on redelivery check since the initial redelivery delay is 4 seconds and the sleep was only 3s + 500ms receive.
Date Wed, 10 Jun 2015 22:21:46 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 789eb9abf -> ce16735bb


Test needs more wait time on redelivery check since the initial
redelivery delay is 4 seconds and the sleep was only 3s + 500ms receive.

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/ce16735b
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/ce16735b
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/ce16735b

Branch: refs/heads/master
Commit: ce16735bb07e9df5e280c9cd9f82b331ee284f24
Parents: 789eb9a
Author: Timothy Bish <tabish121@gmail.com>
Authored: Wed Jun 10 18:21:31 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Wed Jun 10 18:21:31 2015 -0400

----------------------------------------------------------------------
 .../activemq/broker/BrokerRedeliveryTest.java     | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/ce16735b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
index 4320ade..916a655 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/BrokerRedeliveryTest.java
@@ -17,13 +17,14 @@
 package org.apache.activemq.broker;
 
 import java.util.concurrent.TimeUnit;
+
 import javax.jms.Message;
 import javax.jms.MessageConsumer;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
+
 import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.ActiveMQPrefetchPolicy;
 import org.apache.activemq.RedeliveryPolicy;
 import org.apache.activemq.broker.region.policy.RedeliveryPolicyMap;
 import org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy;
@@ -71,13 +72,13 @@ public class BrokerRedeliveryTest extends org.apache.activemq.TestSupport
{
         LOG.info("got: " + message);
         consumerSession.rollback();
 
-        for (int i=0;i<maxBrokerRedeliveriesToValidate;i++) {
+        for (int i = 0; i < maxBrokerRedeliveriesToValidate; i++) {
             Message shouldBeNull = consumer.receive(500);
             assertNull("did not get message after redelivery count exceeded: " + shouldBeNull,
shouldBeNull);
 
-            TimeUnit.SECONDS.sleep(3);
+            TimeUnit.SECONDS.sleep(4);
 
-            Message brokerRedeliveryMessage = consumer.receive(500);
+            Message brokerRedeliveryMessage = consumer.receive(1500);
             LOG.info("got: " + brokerRedeliveryMessage);
             assertNotNull("got message via broker redelivery after delay", brokerRedeliveryMessage);
             assertEquals("message matches", message.getStringProperty("data"), brokerRedeliveryMessage.getStringProperty("data"));
@@ -144,9 +145,9 @@ public class BrokerRedeliveryTest extends org.apache.activemq.TestSupport
{
 
     private void startBroker(boolean deleteMessages) throws Exception {
         broker = new BrokerService();
+        broker.setPersistent(false);
         broker.setSchedulerSupport(true);
 
-
         RedeliveryPlugin redeliveryPlugin = new RedeliveryPlugin();
 
         RedeliveryPolicy brokerRedeliveryPolicy = new RedeliveryPolicy();
@@ -166,13 +167,14 @@ public class BrokerRedeliveryTest extends org.apache.activemq.TestSupport
{
         broker.start();
     }
 
-
     private void stopBroker() throws Exception {
-        if (broker != null)
+        if (broker != null) {
             broker.stop();
-        broker = null;
+            broker = null;
+        }
     }
 
+    @Override
     protected ActiveMQConnectionFactory createConnectionFactory() throws Exception {
         return new ActiveMQConnectionFactory("vm://localhost");
     }


Mime
View raw message