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