diff options
author | Damian Minkov <damencho@jitsi.org> | 2007-06-05 14:52:54 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2007-06-05 14:52:54 +0000 |
commit | 81e83a6eb4db5e48123a605292863145b85b0dbe (patch) | |
tree | afced94c8049e4624994190ec764a9bd0b860089 | |
parent | 76aa0025c523cc0caef5cd8f6840f75493f62e83 (diff) | |
download | jitsi-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.java | 28 |
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" |