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=Broker,brokerName=localhost,destinationType="
+ JMXSupport.encodeObjectNamePart(tQueue.getDestinationTypeAsString())
+ ",destinationName=" + JMXSupport.encodeObjectNamePart(tQueue.getPhysicalName()));
// should not throw an exception
mbeanServer.getObjectInstance(queueViewMBeanName);
tQueue.delete();
Thread.sleep(1000);
try {
// should throw an exception
mbeanServer.getObjectInstance(queueViewMBeanName);