From commits-return-15397-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Thu Jan 20 13:36:06 2011 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 94402 invoked from network); 20 Jan 2011 13:36:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 20 Jan 2011 13:36:06 -0000 Received: (qmail 59526 invoked by uid 500); 20 Jan 2011 13:36:05 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 59454 invoked by uid 500); 20 Jan 2011 13:36:03 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 59446 invoked by uid 99); 20 Jan 2011 13:36:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jan 2011 13:36:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Jan 2011 13:36:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B372623889B3; Thu, 20 Jan 2011 13:35:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@activemq.apache.org From: dejanb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110120133539.B372623889B3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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();