Assert.assertEquals(0, data.length);
}
public void testListMessagesAsJSONWithNullFilter() throws Exception
{
JMSQueueControl queueControl = createManagementControl();
Assert.assertEquals(0, queueControl.getMessageCount());
String[] ids = JMSUtil.sendMessages(queue, 2);
Assert.assertEquals(2, queueControl.getMessageCount());
String jsonString = queueControl.listMessagesAsJSON(null);
Assert.assertNotNull(jsonString);
JSONArray array = new JSONArray(jsonString);
Assert.assertEquals(2, array.length());
Assert.assertEquals(ids[0], array.getJSONObject(0).get("JMSMessageID"));
Assert.assertEquals(ids[1], array.getJSONObject(1).get("JMSMessageID"));
JMSUtil.consumeMessages(2, queue);
jsonString = queueControl.listMessagesAsJSON(null);
Assert.assertNotNull(jsonString);
array = new JSONArray(jsonString);
Assert.assertEquals(0, array.length());
}