mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 03:52:06 +01:00
[sinttest] Move throw statement before setting the listener in mucDestroyTest()
Also add tryDestroy(muc).
This commit is contained in:
parent
bf6b7bd692
commit
d2810cf9b6
1 changed files with 6 additions and 5 deletions
|
@ -99,6 +99,12 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
|
|||
MultiUserChat muc = mucManagerOne.getMultiUserChat(mucAddress);
|
||||
createMuc(muc, Resourcepart.from("one-" + randomString));
|
||||
|
||||
// These would be a test implementation bug, not assertion failure.
|
||||
if (!mucManagerOne.getJoinedRooms().contains(mucAddress)) {
|
||||
tryDestroy(muc);
|
||||
throw new IllegalStateException("Expected user to have joined a room '" + mucAddress + "' (but does not appear to have done so).");
|
||||
}
|
||||
|
||||
final SimpleResultSyncPoint mucDestroyed = new SimpleResultSyncPoint();
|
||||
|
||||
UserStatusListener userStatusListener = new UserStatusListener() {
|
||||
|
@ -110,11 +116,6 @@ public class MultiUserChatIntegrationTest extends AbstractMultiUserChatIntegrati
|
|||
|
||||
muc.addUserStatusListener(userStatusListener);
|
||||
|
||||
// These would be a test implementation bug, not assertion failure.
|
||||
if (!mucManagerOne.getJoinedRooms().contains(mucAddress)) {
|
||||
throw new IllegalStateException("Expected user to have joined a room '" + mucAddress + "' (but does not appear to have done so).");
|
||||
}
|
||||
|
||||
try {
|
||||
muc.destroy("Dummy reason", null);
|
||||
assertResult(mucDestroyed, "Expected " + conOne.getUser() + " to be notified of destruction of room " + mucAddress + " (but was not).");
|
||||
|
|
Loading…
Reference in a new issue