From 1d25c350310bb6202cc774244f21096717f2e6bd Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Wed, 15 Dec 2004 01:44:43 +0000 Subject: [PATCH] Added test case for discovering room information. SMACK-11 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2426 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smackx/muc/MultiUserChatTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/org/jivesoftware/smackx/muc/MultiUserChatTest.java b/test/org/jivesoftware/smackx/muc/MultiUserChatTest.java index bc68a0d7f..e3d6c0211 100644 --- a/test/org/jivesoftware/smackx/muc/MultiUserChatTest.java +++ b/test/org/jivesoftware/smackx/muc/MultiUserChatTest.java @@ -315,6 +315,27 @@ public class MultiUserChatTest extends SmackTestCase { assertTrue("Couldn't detect that user1 supports MUC", supports); } + public void testDiscoverRoomInfo() { + try { + makeRoomModerated(); + + RoomInfo info = MultiUserChat.getRoomInfo(getConnection(1), room); + + assertFalse("Room is members-only", info.isMembersOnly()); + assertTrue("Room is moderated", info.isModerated()); + assertFalse("Room is Nonanonymous", info.isNonanonymous()); + assertFalse("Room is PasswordProtected", info.isPasswordProtected()); + assertFalse("Room is Persistent", info.isPersistent()); + assertEquals("Room's description is incorrect", "fruta124", info.getDescription()); + assertEquals("Room's subject is incorrect", "", info.getSubject()); + assertEquals("Number of occupants is incorrect", 1, info.getOccupantsCount()); + } + catch (XMPPException e) { + e.printStackTrace(); + fail(e.getMessage()); + } + } + public void testPrivateChat() { try { // User2 joins the new room