activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kea...@apache.org
Subject git commit: Added timeout in teardown because of intermittent test failures
Date Fri, 03 Jan 2014 09:37:58 GMT
Updated Branches:
  refs/heads/trunk 7db0fe6a3 -> 96bdda716


Added timeout in teardown because of intermittent test failures


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

Branch: refs/heads/trunk
Commit: 96bdda716a2f4f15620528e9869c00a11242bb98
Parents: 7db0fe6
Author: Kevin Earls <kevin@kevinearls.com>
Authored: Fri Jan 3 10:37:48 2014 +0100
Committer: Kevin Earls <kevin@kevinearls.com>
Committed: Fri Jan 3 10:37:48 2014 +0100

----------------------------------------------------------------------
 .../activemq/broker/jmx/MBeanOperationTimeoutTest.java | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/96bdda71/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
----------------------------------------------------------------------
diff --git a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
index f3f4d98..b7c00b8 100644
--- a/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
+++ b/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanOperationTimeoutTest.java
@@ -52,7 +52,7 @@ public class MBeanOperationTimeoutTest {
 
     protected int messageCount = 50000;
 
-    @Test
+    @Test(expected = TimeoutException.class)
     public void testLongOperationTimesOut() throws Exception {
 
         sendMessages(messageCount);
@@ -68,13 +68,8 @@ public class MBeanOperationTimeoutTest {
         long count = proxy.getQueueSize();
         assertEquals("Queue size", count, messageCount);
 
-        try {
-            LOG.info("Attempting to move one message.");
-            proxy.moveMatchingMessagesTo(null, moveToDestinationName);
-            fail("Queue purge should have timed out.");
-        } catch (TimeoutException e) {
-            LOG.info("Queue message move Timed out as expected.");
-        }
+        LOG.info("Attempting to move one message, TimeoutException expected");
+        proxy.moveMatchingMessagesTo(null, moveToDestinationName);
     }
 
     private void sendMessages(int count) throws Exception {
@@ -106,7 +101,6 @@ public class MBeanOperationTimeoutTest {
 
     @Before
     public void setUp() throws Exception {
-
         broker = createBroker();
         broker.start();
         broker.waitUntilStarted();
@@ -118,6 +112,7 @@ public class MBeanOperationTimeoutTest {
 
     @After
     public void tearDown() throws Exception {
+        Thread.sleep(500);
         if (broker != null) {
             broker.stop();
             broker.waitUntilStopped();


Mime
View raw message