activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1404354 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
Date Wed, 31 Oct 2012 21:13:46 GMT
Author: tabish
Date: Wed Oct 31 21:13:45 2012
New Revision: 1404354

URL: http://svn.apache.org/viewvc?rev=1404354&view=rev
Log:
fix brokerSerivce instances left running if assertions fail

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java?rev=1404354&r1=1404353&r2=1404354&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/DuplexNetworkMBeanTest.java
Wed Oct 31 21:13:45 2012
@@ -62,12 +62,15 @@ public class DuplexNetworkMBeanTest {
             BrokerService networkedBroker = null;
             for (int i=0; i<numRestarts; i++) {
                 networkedBroker = createNetworkedBroker();
-                networkedBroker.start();
-                assertEquals(1, countMbeans(networkedBroker, "NetworkBridge", 2000));
-                assertEquals(1, countMbeans(broker, "NetworkBridge", 2000));
-                assertEquals(1, countMbeans(broker, "Connection"));
-                networkedBroker.stop();
-                networkedBroker.waitUntilStopped();
+                try {
+                    networkedBroker.start();
+                    assertEquals(1, countMbeans(networkedBroker, "NetworkBridge", 2000));
+                    assertEquals(1, countMbeans(broker, "NetworkBridge", 2000));
+                    assertEquals(1, countMbeans(broker, "Connection"));
+                } finally {
+                    networkedBroker.stop();
+                    networkedBroker.waitUntilStopped();
+                }
                 assertEquals(0, countMbeans(networkedBroker, "stopped"));
                 assertEquals(0, countMbeans(broker, "NetworkBridge"));
             }



Mime
View raw message