mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
Merge pull request #598 from guusdk/sint_muc-occupant-race
[sinttest] Fix race condition in MUC test
This commit is contained in:
commit
98ff4d8a65
1 changed files with 2 additions and 3 deletions
|
@ -214,16 +214,15 @@ public class MultiUserChatOccupantIntegrationTest extends AbstractMultiUserChatI
|
||||||
final Resourcepart nicknameThree = Resourcepart.from("three-" + randomString);
|
final Resourcepart nicknameThree = Resourcepart.from("three-" + randomString);
|
||||||
|
|
||||||
createMuc(mucAsSeenByOne, nicknameOne);
|
createMuc(mucAsSeenByOne, nicknameOne);
|
||||||
mucAsSeenByTwo.join(nicknameTwo);
|
|
||||||
|
|
||||||
SimpleResultSyncPoint oneSeesTwo = new SimpleResultSyncPoint();
|
SimpleResultSyncPoint oneSeesTwo = new SimpleResultSyncPoint();
|
||||||
mucAsSeenByOne.addParticipantListener(presence -> {
|
mucAsSeenByOne.addParticipantListener(presence -> {
|
||||||
if (nicknameTwo.equals(presence.getFrom().getResourceOrEmpty())) {
|
if (nicknameTwo.equals(presence.getFrom().getResourceOrEmpty())) {
|
||||||
oneSeesTwo.signal();
|
oneSeesTwo.signal();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mucAsSeenByOne.grantModerator(nicknameTwo);
|
mucAsSeenByTwo.join(nicknameTwo);
|
||||||
oneSeesTwo.waitForResult(timeout);
|
oneSeesTwo.waitForResult(timeout);
|
||||||
|
mucAsSeenByOne.grantModerator(nicknameTwo);
|
||||||
|
|
||||||
List<Presence> results = new ArrayList<>();
|
List<Presence> results = new ArrayList<>();
|
||||||
mucAsSeenByThree.addParticipantListener(results::add);
|
mucAsSeenByThree.addParticipantListener(results::add);
|
||||||
|
|
Loading…
Reference in a new issue