mirror of https://github.com/apache/activemq.git
fix brokerSerivce instances left running if assertions fail
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1404354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0ad3cfc11e
commit
5207f02e6a
|
@ -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"));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue