This commit is contained in:
Martyn Taylor 2015-02-26 11:09:04 +00:00
commit 73638a1d22
1 changed files with 9 additions and 4 deletions

View File

@ -26,6 +26,7 @@ import javax.jms.TopicSubscriber;
import javax.management.Notification; import javax.management.Notification;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -194,10 +195,14 @@ public class TopicControlTest extends ManagementTestBase
String jsonString = topicControl.listDurableSubscriptionsAsJSON(); String jsonString = topicControl.listDurableSubscriptionsAsJSON();
SubscriptionInfo[] infos = SubscriptionInfo.from(jsonString); SubscriptionInfo[] infos = SubscriptionInfo.from(jsonString);
Assert.assertEquals(2, infos.length); Assert.assertEquals(2, infos.length);
Assert.assertEquals(clientID, infos[0].getClientID()); List<String> expectedClientIds = Arrays.asList(clientID, clientID + "2");
Assert.assertEquals(subscriptionName, infos[0].getName()); List<String> expectedSubscriptionNames = Arrays.asList(subscriptionName, subscriptionName + "2");
Assert.assertEquals(clientID + "2", infos[1].getClientID());
Assert.assertEquals(subscriptionName + "2", infos[1].getName()); Assert.assertTrue(expectedClientIds.contains(infos[0].getClientID()));
Assert.assertTrue(expectedSubscriptionNames.contains(infos[0].getName()));
Assert.assertTrue(expectedClientIds.contains(infos[1].getClientID()));
Assert.assertTrue(expectedSubscriptionNames.contains(infos[1].getName()));
jsonString = topicControl.listNonDurableSubscriptionsAsJSON(); jsonString = topicControl.listNonDurableSubscriptionsAsJSON();
infos = SubscriptionInfo.from(jsonString); infos = SubscriptionInfo.from(jsonString);