ensure master is always started before first connect attempt, ignore expected exception on shutdown

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@711284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2008-11-04 16:05:01 +00:00
parent c27db108fd
commit 5b47fe7a6c
2 changed files with 7 additions and 4 deletions

View File

@ -61,7 +61,7 @@ public class MasterSlaveTempQueueMemoryTest extends TempQueueMemoryTest {
// because master will wait for slave to connect it needs
// to be in a separate thread
new Thread() {
Thread starterThread = new Thread() {
public void run() {
try {
broker.setWaitForSlave(true);
@ -71,9 +71,11 @@ public class MasterSlaveTempQueueMemoryTest extends TempQueueMemoryTest {
e.printStackTrace();
}
}
}.start();
};
starterThread.start();
slave.start();
starterThread.join(60*1000);
assertTrue("slave is indeed a slave", slave.isSlave());
}
@ -92,10 +94,10 @@ public class MasterSlaveTempQueueMemoryTest extends TempQueueMemoryTest {
AdvisoryBroker ab = (AdvisoryBroker) slave.getBroker().getAdaptor(
AdvisoryBroker.class);
if (!deleteTempQueue) {
if (!deleteTempQueue || serverTransactional) {
// give temp destination removes a chance to perculate on connection.close
Thread.sleep(2000);
}
}
assertEquals("the temp queues should not be visible as they are removed", 1, ab.getAdvisoryDestinations().size());
RegionBroker rb = (RegionBroker) slave.getBroker().getAdaptor(

View File

@ -98,6 +98,7 @@ public class TempQueueMemoryTest extends EmbeddedBrokerTestSupport {
// temp queue will be cleaned up on clientConnection.close
}
}
} catch (IllegalStateException IgnoredAsCanOcurrDuringShutdown) {
} catch (JMSException e) {
// TODO Auto-generated catch block
e.printStackTrace();