aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2007-06-05 14:52:54 +0000
committerDamian Minkov <damencho@jitsi.org>2007-06-05 14:52:54 +0000
commit81e83a6eb4db5e48123a605292863145b85b0dbe (patch)
treeafced94c8049e4624994190ec764a9bd0b860089
parent76aa0025c523cc0caef5cd8f6840f75493f62e83 (diff)
downloadjitsi-81e83a6eb4db5e48123a605292863145b85b0dbe.zip
jitsi-81e83a6eb4db5e48123a605292863145b85b0dbe.tar.gz
jitsi-81e83a6eb4db5e48123a605292863145b85b0dbe.tar.bz2
Retry QueryContactStatus on fail.
-rw-r--r--test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java
index c749b69..8c1ec4b 100644
--- a/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java
+++ b/test/net/java/sip/communicator/slick/protocol/msn/TestOperationSetPresence.java
@@ -402,6 +402,34 @@ public class TestOperationSetPresence
logger.trace("will query for contact("+ fixture.userID2 + ") status!");
PresenceStatus actualReturn
= operationSetPresence1.queryContactStatus(fixture.userID2);
+
+ // sometimes happens that no status are received
+ // will change the status and try again
+ if(!actualReturn.equals(expectedReturn))
+ {
+ logger.info("subtestQueryContactStatus for " + status +
+ " Failed - trying again!");
+
+ PresenceStatus tempStatus;
+ if(status.equals(MsnStatusEnum.ONLINE))
+ tempStatus = MsnStatusEnum.AWAY;
+ else
+ tempStatus = MsnStatusEnum.ONLINE;
+
+ // reset the status so we can change it once again
+ operationSetPresence2.publishPresenceStatus(status, "status message");
+
+ pauseAfterStateChanges();
+
+ // now try again
+ operationSetPresence2.publishPresenceStatus(status, "status message");
+
+ pauseAfterStateChanges();
+
+ actualReturn
+ = operationSetPresence1.queryContactStatus(fixture.userID2);
+ }
+
assertEquals("Querying a "
+ expectedReturn.getStatusName()
+ " state did not return as expected"