mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-3041 - unregister mbean for temp dest
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1061296 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec30bf0c95
commit
e511e76d4f
|
@ -48,6 +48,8 @@ import org.apache.activemq.broker.region.policy.PolicyMap;
|
|||
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 EmbeddedBrokerTestSupport {
|
|||
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();
|
||||
|
|
Loading…
Reference in New Issue