Package org.apache.vysper.xmpp.modules.extension.xep0045_muc.model

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.model.Occupant


                new MucUserItem(null, null, Affiliation.Outcast, Role.None), StatusCode.BEEN_BANNED, occupant1Queue.getNext());
    }

    public void testNonAdmin() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM2_JID, "Room 2");
        Occupant occupant1 = room.addOccupant(OCCUPANT1_JID, "nick");
        occupant1.setRole(Role.Moderator);
        room.getAffiliations().add(OCCUPANT1_JID, Affiliation.Member);

        room.addOccupant(OCCUPANT2_JID, "Nick 2");

        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, Affiliation.None, null);
View Full Code Here


        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, Affiliation.None, null);
    }

    public void testAdminBanningOwner() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM2_JID, "Room 2");
        Occupant occupant1 = room.addOccupant(OCCUPANT1_JID, "nick");
        occupant1.setRole(Role.Moderator);
        room.getAffiliations().add(OCCUPANT1_JID, Affiliation.Admin);

        room.addOccupant(OCCUPANT2_JID, "Nick 2");
        room.getAffiliations().add(OCCUPANT2_JID, Affiliation.Owner);
View Full Code Here

*/
public class RevokeModeratorTestCase extends AbstractGrantRevokeTestCase {

    public void testRevokeModerator() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM2_JID, "Room 2");
        Occupant occ1 = room.addOccupant(OCCUPANT1_JID, "nick");
        occ1.setRole(Role.Moderator);
        room.getAffiliations().add(OCCUPANT1_JID, Affiliation.Admin);
       
        Occupant occ2 = room.addOccupant(OCCUPANT2_JID, "Nick 2");
        occ2.setRole(Role.Moderator);
        room.getAffiliations().add(OCCUPANT2_JID, Affiliation.Member);

        // send message to room
        IQStanza result = (IQStanza) IQStanza.getWrapper(sendIq(OCCUPANT1_JID, ROOM2_JID, SET, "id1",
                NamespaceURIs.XEP0045_MUC_ADMIN, new IqAdminItem("Nick 2", Role.Participant)));
View Full Code Here

                new MucUserItem(null, null, Affiliation.Member, Role.Participant), null, occupant1Queue.getNext());
    }

    public void testMemberAttemptRevokeModerator() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM2_JID, "Room 2");
        Occupant occupant1 = room.addOccupant(OCCUPANT1_JID, "nick");
        room.getAffiliations().add(OCCUPANT1_JID, Affiliation.Member);
        occupant1.setRole(Role.Moderator);

        room.addOccupant(OCCUPANT2_JID, "Nick 2").setRole(Role.Moderator);

        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, null, Role.Participant);
    }
View Full Code Here

        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, null, Role.Participant);
    }

    public void testAttemptRevokeOwnerModerator() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM2_JID, "Room 2");
        Occupant occupant1 = room.addOccupant(OCCUPANT1_JID, "nick");
        room.getAffiliations().add(OCCUPANT1_JID, Affiliation.Owner);
        occupant1.setRole(Role.Moderator);

        Occupant occupant2 = room.addOccupant(OCCUPANT2_JID, "Nick 2");
        room.getAffiliations().add(OCCUPANT2_JID, Affiliation.Owner);
        occupant2.setRole(Role.Moderator);

        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, null, Role.Participant);
    }
View Full Code Here

        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, null, Role.Participant);
    }

    public void testAttemptRevokeAdminModerator() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM2_JID, "Room 2");
        Occupant occupant1 = room.addOccupant(OCCUPANT1_JID, "nick");
        room.getAffiliations().add(OCCUPANT1_JID, Affiliation.Admin);
        occupant1.setRole(Role.Moderator);

        Occupant occupant2 = room.addOccupant(OCCUPANT2_JID, "Nick 2");
        room.getAffiliations().add(OCCUPANT2_JID, Affiliation.Owner);
        occupant2.setRole(Role.Moderator);

        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, null, Role.Participant);
    }
View Full Code Here

        assertChangeNotAllowed("Nick 2", StanzaErrorCondition.NOT_ALLOWED, null, Role.Participant);
    }

    public void testToRevokeYourself() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM2_JID, "Room 2");
        Occupant occupant1 = room.addOccupant(OCCUPANT1_JID, "nick");
        occupant1.setRole(Role.Moderator);

        // added only for presence check later
        room.addOccupant(OCCUPANT2_JID, "Nick 2");
        room.getAffiliations().add(OCCUPANT1_JID, Affiliation.Owner);
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.modules.extension.xep0045_muc.model.Occupant

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.