diff options
Diffstat (limited to 'test/net/java')
-rw-r--r-- | test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java | 3 | ||||
-rw-r--r-- | test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java | 25 |
2 files changed, 22 insertions, 6 deletions
diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java index 6f67b71..d992529 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPersistentPresence.java @@ -141,7 +141,8 @@ public class TestOperationSetPersistentPresence // the sever creates a group NotInContactList, // beacuse the buddy we are sending message to is not in // the contactlist. So this group must be ignored - if(!group.getGroupName().equals("NotInContactList")) + // all not persistent groups must be ignored + if(group.isPersistent()) { assertNotNull("Group " + group.getGroupName() + " was returned by " diff --git a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java index 6ac2e30..9aa39a5 100644 --- a/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java +++ b/test/net/java/sip/communicator/slick/protocol/icq/TestOperationSetPresence.java @@ -575,12 +575,27 @@ public class TestOperationSetPresence //don't want any more events operationSetPresence.removeSubscriptionListener(subEvtCollector); } - - assertEquals("Subscription event dispatching failed." - , 1, subEvtCollector.collectedEvents.size()); - EventObject evt = - (EventObject)subEvtCollector.collectedEvents.get(0); + // after adding awaitingAuthorization group here are catched 3 events + // 1 - creating unresolved contact + // 2 - move of the contact to awaitingAuthorization group + // 3 - move of the contact from awaitingAuthorization group to original group + assertTrue("Subscription event dispatching failed." + , subEvtCollector.collectedEvents.size() > 0); + + EventObject evt = null; + + Iterator events = subEvtCollector.collectedEvents.iterator(); + while (events.hasNext()) + { + Object elem = events.next(); + if(elem instanceof SubscriptionEvent) + { + if(((SubscriptionEvent)elem).getEventID() + == SubscriptionEvent.SUBSCRIPTION_CREATED) + evt = (SubscriptionEvent)elem; + } + } Object source = null; Contact srcContact = null; |