test/net/java/sip/communicator/slick/protocol/jabber/TestOperationSetMultiUserChat2.java
/**
     * The owner of the room (the user who created it, and which is an
     * administrator too, typically user1) will revoke membership's role to one
     * of our peers (user2).
     * The considered participant is then supposed to be a guest.
     *
     * @throws OperationNotSupportedException
     * @throws OperationFailedException
     */
The owner of the room (the user who created it, and which is an
administrator too, typically user1) will revoke membership's role to one
of our peers (user2).
The considered participant is then supposed to be a guest.


The owner of the room ( the user who created it and which is an administrator too typically user1 ) will revoke membership ' s role to one of our peers ( user2 ) . The considered participant is then supposed to be a guest .
public void testRevokeMembership()
    throws OperationFailedException, OperationNotSupportedException
    {
        try
        {
            Thread.sleep(2000);
        }
        catch (InterruptedException ex)
        {}
        String roomName = testRoomBaseName + roomID;
        logger.info("--- Start testRevokeMembership room:" + roomName);
        ChatRoom roomUser1 = opSetMUC1.findRoom(roomName);
        assertNotNull("The room can't be retrieved on user1's side", roomUser1);
        ChatRoom roomUser3 = opSetMUC3.findRoom(roomName);
        assertNotNull("The room can't be retrieved on user3's side", roomUser3);
        MUCEventCollector roomUser3Col = new MUCEventCollector(
            roomUser3, MUCEventCollector.EVENT_ROLE);
        roomUser1.revokeMembership(fixture.userID2);
        roomUser3Col.waitForEvent(10000);
        assertEquals("Wrong count of collected events on user3's side",
            1, roomUser3Col.collectedEvents.size());
        ChatRoomMemberRoleChangeEvent roleEventUser3 =
            (ChatRoomMemberRoleChangeEvent) roomUser3Col.collectedEvents.get(0);
        assertEquals("Collected event does not belong to the right chatroom",
            roomName, XmppStringUtils.parseLocalpart(
                roleEventUser3.getSourceChatRoom().getName()));
        assertEquals("Collected event does not belong to the expected user",
            fixture.userID2,
            roleEventUser3.getSourceMember().getContactAddress());
        assertEquals("User2's previous role does not match",
            ChatRoomMemberRole.MEMBER, roleEventUser3.getPreviousRole());
        assertEquals("Unexpected new role",
            ChatRoomMemberRole.GUEST, roleEventUser3.getNewRole());
        logger.info("--- End testRevokeMembership room:" + roomName);
    }
public void testRevokeMembership ( ) throws OperationFailedException , OperationNotSupportedException { try { Thread . sleep ( 2000 ) ; } catch ( InterruptedException ex ) { } String roomName = testRoomBaseName + roomID ; logger . info ( "--- Start testRevokeMembership room:" + roomName ) ; ChatRoom roomUser1 = opSetMUC1 . findRoom ( roomName ) ; assertNotNull ( "The room can't be retrieved on user1's side" , roomUser1 ) ; ChatRoom roomUser3 = opSetMUC3 . findRoom ( roomName ) ; assertNotNull ( "The room can't be retrieved on user3's side" , roomUser3 ) ; MUCEventCollector roomUser3Col = new MUCEventCollector ( roomUser3 , MUCEventCollector . EVENT_ROLE ) ; roomUser1 . revokeMembership ( fixture . userID2 ) ; roomUser3Col . waitForEvent ( 10000 ) ; assertEquals ( "Wrong count of collected events on user3's side" , 1 , roomUser3Col . collectedEvents . size ( ) ) ; ChatRoomMemberRoleChangeEvent roleEventUser3 = ( ChatRoomMemberRoleChangeEvent ) roomUser3Col . collectedEvents . get ( 0 ) ; assertEquals ( "Collected event does not belong to the right chatroom" , roomName , XmppStringUtils . parseLocalpart ( roleEventUser3 . getSourceChatRoom ( ) . getName ( ) ) ) ; assertEquals ( "Collected event does not belong to the expected user" , fixture . userID2 , roleEventUser3 . getSourceMember ( ) . getContactAddress ( ) ) ; assertEquals ( "User2's previous role does not match" , ChatRoomMemberRole . MEMBER , roleEventUser3 . getPreviousRole ( ) ) ; assertEquals ( "Unexpected new role" , ChatRoomMemberRole . GUEST , roleEventUser3 . getNewRole ( ) ) ; logger . info ( "--- End testRevokeMembership room:" + roomName ) ; }
The owner of the room (the user who created it, and which is an
 administrator too, typically user1) will revoke membership's role to one
 of our peers (user2).
The owner of the room ( the user who created it and which is an administrator too typically user1 ) will revoke membership ' s role to one of our peers ( user2 ) .
// Owner of the room revokes user2 member rights: