Assert.assertEquals(queue.isTemporary(), queueControl.isTemporary());
}
public void testGetXXXCount() throws Exception
{
JMSQueueControl queueControl = createManagementControl();
Assert.assertEquals(0, queueControl.getMessageCount());
Assert.assertEquals(0, queueControl.getConsumerCount());
Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
MessageConsumer consumer = JMSUtil.createConsumer(connection, queue);
Assert.assertEquals(1, queueControl.getConsumerCount());
JSONArray jsonArray = new JSONArray(queueControl.listConsumersAsJSON());
assertEquals(1, jsonArray.length());
JMSUtil.sendMessages(queue, 2);
Assert.assertEquals(2, queueControl.getMessageCount());
Assert.assertEquals(2, queueControl.getMessagesAdded());
connection.start();
Assert.assertNotNull(consumer.receive(500));
Assert.assertNotNull(consumer.receive(500));
Assert.assertEquals(0, queueControl.getMessageCount());
Assert.assertEquals(2, queueControl.getMessagesAdded());
consumer.close();
Assert.assertEquals(0, queueControl.getConsumerCount());
connection.close();
}