mirror of https://github.com/apache/activemq.git
fix intermittent ci failure, remove dependency on free jmx rmi port
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1307340 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
33cdefaf2e
commit
6110e16f28
|
@ -82,7 +82,7 @@ public class JMXRemoveQueueThenSendIgnoredTest {
|
||||||
MessageConsumer firstConsumer = registerConsumer();
|
MessageConsumer firstConsumer = registerConsumer();
|
||||||
produceMessage();
|
produceMessage();
|
||||||
Message message = firstConsumer.receive(5000);
|
Message message = firstConsumer.receive(5000);
|
||||||
LOG.debug("Received message " + message);
|
LOG.info("Received message " + message);
|
||||||
|
|
||||||
assertEquals(1, numberOfMessages());
|
assertEquals(1, numberOfMessages());
|
||||||
firstConsumer.close();
|
firstConsumer.close();
|
||||||
|
@ -106,7 +106,7 @@ public class JMXRemoveQueueThenSendIgnoredTest {
|
||||||
MessageConsumer firstConsumer = registerConsumer();
|
MessageConsumer firstConsumer = registerConsumer();
|
||||||
produceMessage();
|
produceMessage();
|
||||||
Message message = firstConsumer.receive(5000);
|
Message message = firstConsumer.receive(5000);
|
||||||
LOG.debug("Received message " + message);
|
LOG.info("Received message " + message);
|
||||||
|
|
||||||
assertEquals(1, numberOfMessages());
|
assertEquals(1, numberOfMessages());
|
||||||
firstConsumer.close();
|
firstConsumer.close();
|
||||||
|
@ -131,14 +131,11 @@ public class JMXRemoveQueueThenSendIgnoredTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int numberOfMessages() throws Exception {
|
private int numberOfMessages() throws Exception {
|
||||||
JMXConnector jmxConnector = JMXConnectorFactory.connect(new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi"));
|
|
||||||
MBeanServerConnection mbeanServerConnection = jmxConnector.getMBeanServerConnection();
|
|
||||||
ObjectName queueViewMBeanName = new ObjectName(
|
ObjectName queueViewMBeanName = new ObjectName(
|
||||||
domain + ":Type=Queue,Destination=myqueue,BrokerName=dev");
|
domain + ":Type=Queue,Destination=myqueue,BrokerName=dev");
|
||||||
QueueViewMBean queue = (QueueViewMBean)MBeanServerInvocationHandler.newProxyInstance(
|
QueueViewMBean queue = (QueueViewMBean)
|
||||||
mbeanServerConnection, queueViewMBeanName, QueueViewMBean.class, true);
|
brokerService.getManagementContext().newProxyInstance(queueViewMBeanName, QueueViewMBean.class, true);
|
||||||
long size = queue.getQueueSize();
|
long size = queue.getQueueSize();
|
||||||
jmxConnector.close();
|
|
||||||
return (int)size;
|
return (int)size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue