@Test public void testCreateDurableQueueUsingJMXAndRestartServer() throws Exception { String queueName = RandomUtil.randomString(); String binding = RandomUtil.randomString(); UnitTestCase.checkNoBinding(context, binding); checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName)); JMSServerControl control = ManagementControlHelper.createJMSServerControl(mbeanServer); control.createQueue(queueName, binding); Object o = UnitTestCase.checkBinding(context, binding); Assert.assertTrue(o instanceof Queue); Queue queue = (Queue) o; assertEquals(queueName, queue.getQueueName()); checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName)); serverManager.stop(); checkNoBinding(context, binding); checkNoResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName)); serverManager = createJMSServer(); serverManager.start(); o = UnitTestCase.checkBinding(context, binding); Assert.assertTrue(o instanceof Queue); queue = (Queue) o; assertEquals(queueName, queue.getQueueName()); checkResource(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName)); }
protected JMSServerControl createJMSControl() throws Exception { return ManagementControlHelper.createJMSServerControl(mbeanServer); }
protected ConnectionFactoryControl createCFControl(String name) throws Exception { return ManagementControlHelper.createConnectionFactoryControl(name, mbeanServer); }