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/a367eaae
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/a367eaae
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/a367eaae

Branch: refs/heads/activemq-5.9
Commit: a367eaaea10c008c5b44ed2d35f1135dfd924784
Parents: 7eff195
Author: Kevin Earls <[email protected]>
Authored: Thu Nov 7 13:48:21 2013 +0100
Committer: Hadrian Zbarcea <[email protected]>
Committed: Wed Mar 12 09:02:48 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/activemq/blob/a367eaae/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 = 

Reply via email to