Added test for double subscription message to the same topic

This commit is contained in:
selva.andre
2012-07-16 22:28:26 +02:00
parent b5903bbf84
commit a7ad0720bc
3 changed files with 39 additions and 6 deletions
@@ -18,7 +18,11 @@ public class SimpleMessaging implements IMessaging {
}
public void subscribe(String clientId, String topic, QOSType qos) {
subscriptions.add(new Subscription(clientId, topic, qos));
Subscription newSubscription = new Subscription(clientId, topic, qos);
if (subscriptions.contains(newSubscription)) {
return;
}
subscriptions.add(newSubscription);
}
protected List<Subscription> getSubscriptions() {