activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r1061296 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
Date Thu, 20 Jan 2011 13:35:39 GMT
Author: dejanb
Date: Thu Jan 20 13:35:39 2011
New Revision: 1061296

URL: http://svn.apache.org/viewvc?rev=1061296&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3041 - unregister mbean for temp dest

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java?rev=1061296&r1=1061295&r2=1061296&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/jmx/MBeanTest.java
Thu Jan 20 13:35:39 2011
@@ -48,6 +48,8 @@ import org.apache.activemq.broker.region
 import org.apache.activemq.broker.region.policy.SharedDeadLetterStrategy;
 import org.apache.activemq.command.ActiveMQBlobMessage;
 import org.apache.activemq.command.ActiveMQQueue;
+import org.apache.activemq.command.ActiveMQTempQueue;
+import org.apache.activemq.util.JMXSupport;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -607,6 +609,33 @@ public class MBeanTest extends EmbeddedB
         return "test.new.destination." + getClass() + "." + getName();
     }
 
+
+    public void testTempQueueJMXDelete() throws Exception {
+        connection = connectionFactory.createConnection();
+        
+        connection.setClientID(clientID);
+        connection.start();
+        Session session = connection.createSession(transacted, authMode);
+        ActiveMQTempQueue tQueue = (ActiveMQTempQueue) session.createTemporaryQueue();
+        Thread.sleep(1000);
+        ObjectName queueViewMBeanName = assertRegisteredObjectName(domain + ":Type="+  JMXSupport.encodeObjectNamePart(tQueue.getDestinationTypeAsString())+",Destination="
+ JMXSupport.encodeObjectNamePart(tQueue.getPhysicalName()) + ",BrokerName=localhost");
+        
+        // should not throw an exception
+        mbeanServer.getObjectInstance(queueViewMBeanName);
+
+        tQueue.delete();
+        Thread.sleep(1000);
+        try {
+            // should throw an exception
+            mbeanServer.getObjectInstance(queueViewMBeanName);
+
+            fail("should be deleted already!");
+        } catch (Exception e) {
+            // expected!
+        }
+
+    }
+
     // Test for AMQ-3029
     public void testBrowseBlobMessages() throws Exception {
         connection = connectionFactory.createConnection();



Mime
View raw message