aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2012-05-08 08:44:27 +0000
committerDamian Minkov <damencho@jitsi.org>2012-05-08 08:44:27 +0000
commit94f6566e68aecd3eaf1f788d07e39d4eefbd31e2 (patch)
treebaad075cfb164b1d8f0244ddb4f75c3cde6433f2
parentcb821dab74c47ecdf9a78d9d0e3e781b7c99824c (diff)
downloadjitsi-94f6566e68aecd3eaf1f788d07e39d4eefbd31e2.zip
jitsi-94f6566e68aecd3eaf1f788d07e39d4eefbd31e2.tar.gz
jitsi-94f6566e68aecd3eaf1f788d07e39d4eefbd31e2.tar.bz2
Fixes build.
-rw-r--r--test/net/java/sip/communicator/slick/protocol/generic/TestOperationSetFileTransfer.java34
1 files changed, 24 insertions, 10 deletions
diff --git a/test/net/java/sip/communicator/slick/protocol/generic/TestOperationSetFileTransfer.java b/test/net/java/sip/communicator/slick/protocol/generic/TestOperationSetFileTransfer.java
index c71ed46..398d110 100644
--- a/test/net/java/sip/communicator/slick/protocol/generic/TestOperationSetFileTransfer.java
+++ b/test/net/java/sip/communicator/slick/protocol/generic/TestOperationSetFileTransfer.java
@@ -185,26 +185,40 @@ public abstract class TestOperationSetFileTransfer
,receiveFile);
receiverStatusListener.waitForEvent(30000, 3);
- assertEquals("A file transfer status changed - " +
+
+ // Some times we can receive only two events,
+ // when connection is quickly established the preparing event
+ // is missing.
+
+ assertTrue("A file transfer status changed - " +
"preparing, inprogress and completed received on receiver side"
- , 3, receiverStatusListener.collectedEvents.size());
+ , 3 == receiverStatusListener.collectedEvents.size()
+ ||
+ 2 == receiverStatusListener.collectedEvents.size());
fileTransferStatusEvent
= receiverStatusListener.collectedEvents.get(0);
- assertEquals("Event must be preparing"
- ,FileTransferStatusChangeEvent.PREPARING
- ,fileTransferStatusEvent.getNewStatus());
+ if(receiverStatusListener.collectedEvents.size() == 3)
+ {
+ assertEquals("Event must be preparing"
+ ,FileTransferStatusChangeEvent.PREPARING
+ ,fileTransferStatusEvent.getNewStatus());
- fileTransferStatusEvent
- = receiverStatusListener.collectedEvents.get(1);
+ fileTransferStatusEvent
+ = receiverStatusListener.collectedEvents.get(1);
+ }
- assertEquals("Event must be completed"
+ assertEquals("Event must be in_progress"
,FileTransferStatusChangeEvent.IN_PROGRESS
,fileTransferStatusEvent.getNewStatus());
- fileTransferStatusEvent
- = receiverStatusListener.collectedEvents.get(2);
+ if(receiverStatusListener.collectedEvents.size() == 3)
+ fileTransferStatusEvent
+ = receiverStatusListener.collectedEvents.get(2);
+ else
+ fileTransferStatusEvent
+ = receiverStatusListener.collectedEvents.get(1);
assertEquals("Event must be completed"
,FileTransferStatusChangeEvent.COMPLETED