prevent test from hanging build, add knowlege of health bean

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1424461 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary Tully 2012-12-20 13:44:10 +00:00
parent bf9c4c60d8
commit abf7adc0be
1 changed files with 6 additions and 2 deletions

View File

@ -108,6 +108,8 @@ public class DiscoveryNetworkReconnectTest {
// expected MBeans
allowing (managementContext).registerMBean(with(any(Object.class)), with(equal(
new ObjectName("Test:BrokerName=BrokerNC,Type=Broker"))));
allowing (managementContext).registerMBean(with(any(Object.class)), with(equal(
new ObjectName("Test:BrokerName=BrokerNC,Type=Health"))));
allowing (managementContext).registerMBean(with(any(Object.class)), with(equal(
new ObjectName("Test:BrokerName=BrokerNC,Type=NetworkConnector,NetworkConnectorName=NC"))));
allowing (managementContext).registerMBean(with(any(Object.class)), with(equal(
@ -138,6 +140,8 @@ public class DiscoveryNetworkReconnectTest {
allowing (managementContext).unregisterMBean(with(equal(
new ObjectName("Test:BrokerName=BrokerNC,Type=Broker"))));
allowing (managementContext).unregisterMBean(with(equal(
new ObjectName("Test:BrokerName=BrokerNC,Type=Health"))));
allowing (managementContext).unregisterMBean(with(equal(
new ObjectName("Test:BrokerName=BrokerNC,Type=NetworkConnector,NetworkConnectorName=NC"))));
allowing (managementContext).unregisterMBean(with(equal(
@ -202,13 +206,13 @@ public class DiscoveryNetworkReconnectTest {
}));
// wait for network connector
assertTrue("network connector mbean registered within 3 minute", mbeanRegistered.tryAcquire(180, TimeUnit.SECONDS));
assertTrue("network connector mbean registered within 1 minute", mbeanRegistered.tryAcquire(60, TimeUnit.SECONDS));
// force an inactivity timeout via the proxy
proxy.pause();
// wait for the inactivity timeout and network shutdown
assertTrue("network connector mbean unregistered within 3 minute", mbeanUnregistered.tryAcquire(180, TimeUnit.SECONDS));
assertTrue("network connector mbean unregistered within 1 minute", mbeanUnregistered.tryAcquire(60, TimeUnit.SECONDS));
// whack all connections
proxy.close();