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 // because master will wait for slave to connect it needs
// to be in a separate thread // to be in a separate thread
new Thread() { Thread starterThread = new Thread() {
public void run() { public void run() {
try { try {
broker.setWaitForSlave(true); broker.setWaitForSlave(true);
@ -71,9 +71,11 @@ public class MasterSlaveTempQueueMemoryTest extends TempQueueMemoryTest {
e.printStackTrace(); e.printStackTrace();
} }
} }
}.start(); };
starterThread.start();
slave.start(); slave.start();
starterThread.join(60*1000);
assertTrue("slave is indeed a slave", slave.isSlave()); assertTrue("slave is indeed a slave", slave.isSlave());
} }
@ -92,7 +94,7 @@ public class MasterSlaveTempQueueMemoryTest extends TempQueueMemoryTest {
AdvisoryBroker ab = (AdvisoryBroker) slave.getBroker().getAdaptor( AdvisoryBroker ab = (AdvisoryBroker) slave.getBroker().getAdaptor(
AdvisoryBroker.class); AdvisoryBroker.class);
if (!deleteTempQueue) { if (!deleteTempQueue || serverTransactional) {
// give temp destination removes a chance to perculate on connection.close // give temp destination removes a chance to perculate on connection.close
Thread.sleep(2000); Thread.sleep(2000);
} }

View File

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