test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat2.java
/**
     * <tt>testFindRoom</tt> will looks for an unexisting room and an existing
     * one to see if results are what we expect.
     */
testFindRoom will looks for an unexisting room and an existing
one to see if results are what we expect.
testFindRoom will looks for an unexisting room and an existing one to see if results are what we expect .
public void testFindRoom()
        throws OperationFailedException,
               OperationNotSupportedException
    {
        String testRoomName = testRoomBaseName + roomID++;
        ChatRoom opSet1Room =
            opSetMUC1.createChatRoom(testRoomName, null);
        opSet1Room.join();
        ChatRoom foundRoom = null;
        /*
         //findRoom always returns ChatRoom instance. If it doesn't exists in
         //the cache it creates an instance of ChatRoom.
        try
        {
            foundRoom = opSetMUC1.findRoom("WhoCreatedThatRoom");
        }
        catch (Exception ex)
        {
            //ok, no one created a room named "WhoCreatedThatRoom"
        }
        assertNull("wasnt expecting to find the room named " +
            "'WhoCreatedThatRoom' on server", foundRoom);
*/
        try
        {
            foundRoom = opSetMUC2.findRoom(testRoomName);
        }
        catch (Exception ex)
        {
            logger.warn(ex);
        }
        assertNotNull("failed to find an existing room on server", foundRoom);
        assertEquals(
            "the room found is not exactly the one we were looking for"
            , opSet1Room.getName(), foundRoom.getName());
    }
public void testFindRoom ( ) throws OperationFailedException , OperationNotSupportedException { String testRoomName = testRoomBaseName + roomID ++ ; ChatRoom opSet1Room = opSetMUC1 . createChatRoom ( testRoomName , null ) ; opSet1Room . join ( ) ; ChatRoom foundRoom = null ; /*
         //findRoom always returns ChatRoom instance. If it doesn't exists in
         //the cache it creates an instance of ChatRoom.

        try
        {
            foundRoom = opSetMUC1.findRoom("WhoCreatedThatRoom");
        }
        catch (Exception ex)
        {
            //ok, no one created a room named "WhoCreatedThatRoom"
        }
        assertNull("wasnt expecting to find the room named " +
            "'WhoCreatedThatRoom' on server", foundRoom);
*/ try { foundRoom = opSetMUC2 . findRoom ( testRoomName ) ; } catch ( Exception ex ) { logger . warn ( ex ) ; } assertNotNull ( "failed to find an existing room on server" , foundRoom ) ; assertEquals ( "the room found is not exactly the one we were looking for" , opSet1Room . getName ( ) , foundRoom . getName ( ) ) ; }
<tt>testFindRoom</tt> will looks for an unexisting room and an existing
 one to see if results are what we expect.
<tt > testFindRoom< / tt > will looks for an unexisting room and an existing one to see if results are what we expect .
// we create the test room // to find the existing room created with opSetMUC1, // we will use opSetMUC2 to be sure the room will not be retrieved from // opSetMUC1 cache