mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-17 04:32:04 +01:00
Added test for anonymous users joining a room.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2441 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
9cf3d53132
commit
5386c77c7f
1 changed files with 32 additions and 0 deletions
|
@ -234,6 +234,38 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
public void testAnonymousParticipant() {
|
||||
try {
|
||||
// Anonymous user joins the new room
|
||||
XMPPConnection anonConnection = new XMPPConnection(getHost(), getPort());
|
||||
anonConnection.loginAnonymously();
|
||||
MultiUserChat muc2 = new MultiUserChat(anonConnection, room);
|
||||
muc2.join("testbot2");
|
||||
Thread.sleep(400);
|
||||
|
||||
// User1 checks the presence of Anonymous user in the room
|
||||
Presence presence = muc.getOccupantPresence(room + "/testbot2");
|
||||
assertNotNull("Presence of user2 in room is missing", presence);
|
||||
assertEquals(
|
||||
"Presence mode of user2 is wrong",
|
||||
Presence.Mode.AVAILABLE,
|
||||
presence.getMode());
|
||||
|
||||
// Anonymous user leaves the room
|
||||
muc2.leave();
|
||||
anonConnection.close();
|
||||
Thread.sleep(250);
|
||||
// User1 checks the presence of Anonymous user in the room
|
||||
presence = muc.getOccupantPresence(room + "/testbot2");
|
||||
assertNull("Presence of participant testbotII still exists", presence);
|
||||
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void testInvitation() {
|
||||
final String[] answer = new String[2];
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue