aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2007-04-13 12:20:38 +0000
committerDamian Minkov <damencho@jitsi.org>2007-04-13 12:20:38 +0000
commitd3710014f16347468de9a761c9f0777e980722b2 (patch)
tree0ac9c99a1c0db2052138e857ab8f160012fa63a5 /test
parentb92b0b69d7cd337f65157e5dd095c5bdb9080eaa (diff)
downloadjitsi-d3710014f16347468de9a761c9f0777e980722b2.zip
jitsi-d3710014f16347468de9a761c9f0777e980722b2.tar.gz
jitsi-d3710014f16347468de9a761c9f0777e980722b2.tar.bz2
Yahoo tests enhancement for retry adding buddy if its not correctly added.
Diffstat (limited to 'test')
-rw-r--r--test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java
index 2ead9e6..4d2f1d8 100644
--- a/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/yahoo/TestOperationSetPresence.java
@@ -408,6 +408,40 @@ public class TestOperationSetPresence
.removeContactPresenceStatusListener(contactPresEvtCollector);
}
+ // something happened. the friend is not added correctly will
+ // try to remove it and add it again
+ if(contactPresEvtCollector.collectedEvents.size() == 0)
+ {
+ logger.info("ATTENTION: Yahoo friend not added correctly will remove and add him again");
+
+ // remove it
+ operationSetPresence1.unsubscribe(subEvt.getSourceContact());
+
+ // add it
+ operationSetPresence1.addSubsciptionListener(subEvtCollector);
+ subEvtCollector.collectedEvents.clear();
+ synchronized (subEvtCollector){
+ operationSetPresence1.subscribe(fixture.userID2);
+ //we may already have the event, but it won't hurt to check.
+ subEvtCollector.waitForEvent(10000);
+ operationSetPresence1.removeSubscriptionListener(subEvtCollector);
+ }
+ subEvtCollector.collectedEvents.clear();
+
+ // query it again for the status
+ contactPresEvtCollector.collectedEvents.clear();
+ operationSetPresence1.addContactPresenceStatusListener(
+ contactPresEvtCollector);
+
+ synchronized (contactPresEvtCollector){
+ operationSetPresence2.publishPresenceStatus(newStatus, "new status");
+ //we may already have the event, but it won't hurt to check.
+ contactPresEvtCollector.waitForEvent(10000);
+ operationSetPresence1
+ .removeContactPresenceStatusListener(contactPresEvtCollector);
+ }
+ }
+
assertEquals("Presence Notif. event dispatching failed."
, 1, contactPresEvtCollector.collectedEvents.size());
ContactPresenceStatusChangeEvent presEvt =