activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1307340 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JMXRemoveQueueThenSendIgnoredTest.java
Date Fri, 30 Mar 2012 10:02:26 GMT
Author: gtully
Date: Fri Mar 30 10:02:26 2012
New Revision: 1307340

URL: http://svn.apache.org/viewvc?rev=1307340&view=rev
Log:
fix intermittent ci failure, remove dependency on free jmx rmi port

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JMXRemoveQueueThenSendIgnoredTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JMXRemoveQueueThenSendIgnoredTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JMXRemoveQueueThenSendIgnoredTest.java?rev=1307340&r1=1307339&r2=1307340&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JMXRemoveQueueThenSendIgnoredTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/JMXRemoveQueueThenSendIgnoredTest.java
Fri Mar 30 10:02:26 2012
@@ -82,7 +82,7 @@ public class JMXRemoveQueueThenSendIgnor
         MessageConsumer firstConsumer = registerConsumer();
         produceMessage();
         Message message = firstConsumer.receive(5000);
-        LOG.debug("Received message " + message);
+        LOG.info("Received message " + message);
 
         assertEquals(1, numberOfMessages());
         firstConsumer.close();
@@ -106,7 +106,7 @@ public class JMXRemoveQueueThenSendIgnor
         MessageConsumer firstConsumer = registerConsumer();
         produceMessage();
         Message message = firstConsumer.receive(5000);
-        LOG.debug("Received message " + message);
+        LOG.info("Received message " + message);
 
         assertEquals(1, numberOfMessages());
         firstConsumer.close();
@@ -131,14 +131,11 @@ public class JMXRemoveQueueThenSendIgnor
     }
 
     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(
             domain + ":Type=Queue,Destination=myqueue,BrokerName=dev");
-        QueueViewMBean queue = (QueueViewMBean)MBeanServerInvocationHandler.newProxyInstance(
-                mbeanServerConnection, queueViewMBeanName, QueueViewMBean.class, true);
+        QueueViewMBean queue = (QueueViewMBean)
+                brokerService.getManagementContext().newProxyInstance(queueViewMBeanName,
QueueViewMBean.class, true);
         long size = queue.getQueueSize();
-        jmxConnector.close();
         return (int)size;
     }
 



Mime
View raw message