mirror of https://github.com/apache/activemq.git
validate (wait for) mbean existance before returning an mbean view - get to the bottom of intermittent failure
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@904812 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7a7ac1313b
commit
7b700ee7a2
|
@ -321,8 +321,21 @@ public class ExpiredMessagesTest extends CombinationTestSupport {
|
||||||
name = new ObjectName(domain + ":BrokerName=localhost,Type=Topic,Destination="
|
name = new ObjectName(domain + ":BrokerName=localhost,Type=Topic,Destination="
|
||||||
+ destination.getPhysicalName());
|
+ destination.getPhysicalName());
|
||||||
}
|
}
|
||||||
return (DestinationViewMBean) broker.getManagementContext().newProxyInstance(name, DestinationViewMBean.class,
|
final DestinationViewMBean view = (DestinationViewMBean)
|
||||||
true);
|
broker.getManagementContext().newProxyInstance(name, DestinationViewMBean.class, true);
|
||||||
|
|
||||||
|
assertTrue("validation: Mbean view for " + destination + " exists", Wait.waitFor(new Wait.Condition() {
|
||||||
|
public boolean isSatisified() throws Exception {
|
||||||
|
boolean mbeanExists = false;
|
||||||
|
try {
|
||||||
|
view.getConsumerCount();
|
||||||
|
mbeanExists = true;
|
||||||
|
} catch (Exception notFoundExpectedOnSlowMachines) {
|
||||||
|
}
|
||||||
|
return mbeanExists;
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
|
|
Loading…
Reference in New Issue