activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1453871 - /activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
Date Thu, 07 Mar 2013 13:55:39 GMT
Author: dejanb
Date: Thu Mar  7 13:55:39 2013
New Revision: 1453871

URL: http://svn.apache.org/r1453871
Log:
test for some mbean queries

Modified:
    activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java

Modified: activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java?rev=1453871&r1=1453870&r2=1453871&view=diff
==============================================================================
--- activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
(original)
+++ activemq/trunk/activemq-unit-tests/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
Thu Mar  7 13:55:39 2013
@@ -24,19 +24,8 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
 
-import javax.jms.BytesMessage;
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.Destination;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
+import javax.jms.*;
+import javax.management.*;
 import javax.management.openmbean.CompositeData;
 import javax.management.openmbean.TabularData;
 import junit.textui.TestRunner;
@@ -1266,4 +1255,25 @@ public class MBeanTest extends EmbeddedB
         consumer.close();
         session.close();
     }
+
+    public void testDynamicProducers() throws Exception {
+        connection = connectionFactory.createConnection();
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        MessageProducer producer = session.createProducer(null);
+
+        ObjectName query = new ObjectName(domain + ":type=Broker,brokerName=localhost,endpoint=dynamicProducer,*");
+        Set<ObjectInstance> mbeans = mbeanServer.queryMBeans(query, null);
+        assertEquals(mbeans.size(), 1);
+    }
+
+    public void testDurableSubQuery() throws Exception  {
+        connection = connectionFactory.createConnection();
+        connection.setClientID("test");
+        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+        TopicSubscriber sub = session.createDurableSubscriber(session.createTopic("test.topic"),
"test.consumer");
+
+        ObjectName query = new ObjectName(domain + ":type=Broker,brokerName=localhost,destinationType=Topic,destinationName=test.topic,endpoint=Consumer,consumerId=Durable(*),*");
+        Set<ObjectInstance> mbeans = mbeanServer.queryMBeans(query, null);
+        assertEquals(mbeans.size(), 1);
+    }
 }



Mime
View raw message