Add some additional try / finally blocks to ensure BrokerService stops are issued.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1443034 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Timothy A. Bish 2013-02-06 15:58:16 +00:00
parent 56174e770d
commit dc33c5918f
1 changed files with 21 additions and 10 deletions

View File

@ -66,8 +66,13 @@ public class ComplexRequestReplyTest {
@After
public void tearDown() throws Exception {
shutdownBrokerA();
shutdownBrokerB();
try {
shutdownBrokerA();
} catch (Exception ex) {}
try {
shutdownBrokerB();
} catch (Exception e) {}
}
@Test
@ -137,10 +142,13 @@ public class ComplexRequestReplyTest {
}
private void shutdownBrokerA() throws Exception {
brokerAContext.stop();
brokerA.stop();
brokerA.waitUntilStopped();
brokerA = null;
try {
brokerAContext.stop();
} catch (Exception e) {
brokerA.stop();
brokerA.waitUntilStopped();
brokerA = null;
}
}
private void createBrokerB() throws Exception {
@ -151,10 +159,13 @@ public class ComplexRequestReplyTest {
}
private void shutdownBrokerB() throws Exception {
brokerBContext.stop();
brokerB.stop();
brokerB.waitUntilStopped();
brokerB = null;
try {
brokerBContext.stop();
} finally {
brokerB.stop();
brokerB.waitUntilStopped();
brokerB = null;
}
}
private BrokerService createBroker(String name) throws Exception {