activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r883450 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java
Date Mon, 23 Nov 2009 18:36:02 GMT
Author: gtully
Date: Mon Nov 23 18:35:58 2009
New Revision: 883450

URL: http://svn.apache.org/viewvc?rev=883450&view=rev
Log:
resolve compilation error, test still fails though

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java?rev=883450&r1=883449&r2=883450&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/network/BrokerNetworkWithStuckMessagesTest.java
Mon Nov 23 18:35:58 2009
@@ -18,7 +18,6 @@
 import javax.jms.Queue;
 import javax.jms.QueueBrowser;
 import javax.jms.Session;
-import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
@@ -29,6 +28,7 @@
 import org.apache.activemq.broker.StubConnection;
 import org.apache.activemq.broker.TransportConnector;
 import org.apache.activemq.broker.jmx.ManagementContext;
+import org.apache.activemq.broker.jmx.QueueViewMBean;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQTextMessage;
 import org.apache.activemq.command.ConnectionId;
@@ -360,9 +360,10 @@
         params.put("Destination", queueName);
         ObjectName queueObjectName = ObjectName.getInstance(amqDomain, params);
         
-        ManagementContext mgmtCtx = broker.getManagementContext(); 
-        MBeanServer mbs = mgmtCtx.getMBeanServer(); 
-        Object[] messages = (Object[]) mbs.invoke(queueObjectName, "browse", new Object[0],
new String[0]);
+        ManagementContext mgmtCtx = broker.getManagementContext();
+        QueueViewMBean queueView = (QueueViewMBean)mgmtCtx.newProxyInstance(queueObjectName,
QueueViewMBean.class, true);
+        
+        Object[] messages = (Object[]) queueView.browse();
         
 		LOG.info("+Browsed with JMX: " + messages.length);
         



Mime
View raw message