1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-05 12:41:08 +01:00

Improved timeout logic.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2502 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2005-06-17 22:24:33 +00:00 committed by gaston
parent 93ca7bc991
commit 8a48d3d11e
4 changed files with 39 additions and 11 deletions

View file

@ -148,8 +148,12 @@ public class RosterExchangeManagerTest extends SmackTestCase {
entriesSent = getConnection(0).getRoster().getEntryCount();
entriesReceived = 0;
rosterExchangeManager1.send(getConnection(0).getRoster(), getBareJID(1));
// Wait for 1 second
Thread.sleep(300);
// Wait up to 2 seconds
long initial = System.currentTimeMillis();
while (System.currentTimeMillis() - initial < 2000 &&
(entriesSent != entriesReceived)) {
Thread.sleep(100);
}
}
catch (Exception e) {
fail("An error occured sending the message with the roster");
@ -203,8 +207,12 @@ public class RosterExchangeManagerTest extends SmackTestCase {
entriesSent = getConnection(0).getRoster().getEntryCount();
entriesReceived = 0;
rosterExchangeManager1.send(getConnection(0).getRoster(), getBareJID(1));
// Wait for 1 seconds
Thread.sleep(700);
// Wait up to 2 seconds
long initial = System.currentTimeMillis();
while (System.currentTimeMillis() - initial < 2000 &&
(entriesSent != entriesReceived)) {
Thread.sleep(100);
}
}
catch (Exception e) {
fail("An error occured sending the message with the roster");