You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ke...@apache.org on 2013/11/07 13:48:43 UTC

git commit: Increased timeout to fix AMQ-4854

Updated Branches:
  refs/heads/trunk 50ec158e2 -> 982b728f2


Increased timeout to fix AMQ-4854


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

Branch: refs/heads/trunk
Commit: 982b728f24415513a18cb51097b5a10d2f9b66db
Parents: 50ec158
Author: Kevin Earls <ke...@kevinearls.com>
Authored: Thu Nov 7 13:48:21 2013 +0100
Committer: Kevin Earls <ke...@kevinearls.com>
Committed: Thu Nov 7 13:48:21 2013 +0100

----------------------------------------------------------------------
 .../activemq/JmsRollbackRedeliveryTest.java     | 48 ++++++++++++++++----
 1 file changed, 38 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/982b728f/activemq-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java b/activemq-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
index f9050c0..7952a97 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/JmsRollbackRedeliveryTest.java
@@ -31,10 +31,20 @@ import javax.jms.Session;
 import javax.jms.TextMessage;
 
 import org.apache.activemq.broker.BrokerService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.Rule;
+import org.junit.rules.TestName;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
+import static org.junit.Assert.*;
+
+public class JmsRollbackRedeliveryTest /*extends AutoFailTestSupport*/ {
+    @Rule
+    public TestName testName = new TestName();
+
     protected static final Logger LOG = LoggerFactory.getLogger(JmsRollbackRedeliveryTest.class);
     final int nbMessages = 10;
     final String destinationName = "Destination";
@@ -42,42 +52,54 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
     boolean consumerClose = true;
     boolean rollback = true;
     BrokerService broker;
-    
+
+    @Before
     public void setUp() throws Exception {
-        setAutoFail(true);
-        super.setUp();
+        //setAutoFail(true);
+        //super.setUp();
+
+        LOG.info(">>>> Starting " + testName.getMethodName());
         broker = new BrokerService();
         broker.setPersistent(false);
         broker.setUseJmx(false);
         broker.start();
+        broker.waitUntilStarted();
+
+
     }
 
+    @After
     public void tearDown() throws Exception {
-        super.tearDown();
+        //super.tearDown();
         if (broker != null) {
             broker.stop();
+            broker.waitUntilStopped();
         }
     }
     
-
+    @Test
     public void testRedelivery() throws Exception {
         doTestRedelivery(brokerUrl, false);
     }
 
+    @Test
     public void testRedeliveryWithInterleavedProducer() throws Exception {
         doTestRedelivery(brokerUrl, true);
     }
 
+
+    @Test
     public void testRedeliveryWithPrefetch0() throws Exception {
         doTestRedelivery(brokerUrl + "?jms.prefetchPolicy.queuePrefetch=0", true);
     }
-    
+
+    @Test
     public void testRedeliveryWithPrefetch1() throws Exception {
         doTestRedelivery(brokerUrl + "?jms.prefetchPolicy.queuePrefetch=1", true);
     }
     
     public void doTestRedelivery(String brokerUrl, boolean interleaveProducer) throws Exception {
-
+        LOG.info(">>>> entering doTestRedelivery interleaveProducer is " + interleaveProducer);
         ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(brokerUrl);
         
         Connection connection = connectionFactory.createConnection();
@@ -115,7 +137,8 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
             }
         }
     }
-       
+
+    @Test
     public void testRedeliveryOnSingleConsumer() throws Exception {
 
         ConnectionFactory connectionFactory = 
@@ -149,7 +172,9 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
             session.close();
         }
     }
-    
+
+
+    @Test
     public void testRedeliveryOnSingleSession() throws Exception {
 
         ConnectionFactory connectionFactory = 
@@ -185,6 +210,7 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
     }
     
     // AMQ-1593
+    @Test
     public void testValidateRedeliveryCountOnRollback() throws Exception {
 
         final int numMessages = 1;
@@ -216,6 +242,7 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
     }
     
     // AMQ-1593
+    @Test
     public void testValidateRedeliveryCountOnRollbackWithPrefetch0() throws Exception {
 
        final int numMessages = 1;
@@ -260,6 +287,7 @@ public class JmsRollbackRedeliveryTest extends AutoFailTestSupport {
         session.close();
     }
 
+    @Test
     public void testRedeliveryPropertyWithNoRollback() throws Exception {
         final int numMessages = 1;
         ConnectionFactory connectionFactory =