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

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.model.Room.findOccupantByNick()


    public void testGrantModeration() throws Exception {
        chat.join(NICK1);
       
        Room room = conference.findRoom(EntityImpl.parseUnchecked(ROOM_JID));
        assertEquals(Role.Moderator, room.findOccupantByNick(NICK1).getRole());
       
        chat2.join(NICK2);
       
        chat.grantModerator(NICK2);
        assertEquals(Role.Moderator, room.findOccupantByNick(NICK2).getRole());
View Full Code Here


        assertEquals(Role.Moderator, room.findOccupantByNick(NICK1).getRole());
       
        chat2.join(NICK2);
       
        chat.grantModerator(NICK2);
        assertEquals(Role.Moderator, room.findOccupantByNick(NICK2).getRole());
    }
}
View Full Code Here

        IQStanza result = (IQStanza) IQStanza.getWrapper(sendIq(OCCUPANT1_JID, ROOM2_JID, SET, "id1",
                NamespaceURIs.XEP0045_MUC_ADMIN, new IqAdminItem("Nick 2", Affiliation.Admin)));
       
        assertIqResultStanza(ROOM2_JID, OCCUPANT1_JID, "id1", result);

        assertEquals(Affiliation.Admin, room.findOccupantByNick("Nick 2").getAffiliation());

        // verify that remaining users got presence
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT2_JID, null,
                new MucUserItem(null, null, Affiliation.Admin, Role.Visitor), null, occupant2Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT1_JID, null,
View Full Code Here

        IQStanza result = (IQStanza) IQStanza.getWrapper(sendIq(OCCUPANT1_JID, ROOM2_JID, SET, "id1",
                NamespaceURIs.XEP0045_MUC_ADMIN, new IqAdminItem("Nick 2", Affiliation.Member)));
       
        assertIqResultStanza(ROOM2_JID, OCCUPANT1_JID, "id1", result);

        assertEquals(Affiliation.Member, room.findOccupantByNick("Nick 2").getAffiliation());

        // verify that remaining users got presence
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT2_JID, null,
                new MucUserItem(null, null, Affiliation.Member, Role.Visitor), null, occupant2Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT1_JID, null,
View Full Code Here

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

        assertNotNull(room.findOccupantByNick("Nick 2"));

        // 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.None)));
View Full Code Here

        IQStanza result = (IQStanza) IQStanza.getWrapper(sendIq(OCCUPANT1_JID, ROOM2_JID, SET, "id1",
                NamespaceURIs.XEP0045_MUC_ADMIN, new IqAdminItem("Nick 2", Role.None)));

        assertIqResultStanza(ROOM2_JID, OCCUPANT1_JID, "id1", result);

        assertNull(room.findOccupantByNick("Nick 2"));

        // verify that kicked user got presence
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT2_JID, PresenceStanzaType.UNAVAILABLE,
                new MucUserItem(null, null, Affiliation.None, Role.None), StatusCode.BEEN_KICKED, occupant2Queue.getNext());
View Full Code Here

        form.addField(new Field(null, null, "muc#roomnick", "Nick 2"));
        form.addField(new Field(null, null, "muc#request_allow", "true"));

        sendMessage(OCCUPANT1_JID, ROOM1_JID, new DataFormEncoder().getXML(form));

        assertEquals(Role.Participant, room.findOccupantByNick("Nick 2").getRole());

        // verify that remaining users got presence
        assertPresenceStanza(new EntityImpl(ROOM1_JID, "Nick 2"), OCCUPANT2_JID, null,
                new MucUserItem(null, null, Affiliation.None, Role.Participant), null, occupant2Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM1_JID, "Nick 2"), OCCUPANT1_JID, null,
View Full Code Here

        IQStanza result = (IQStanza) IQStanza.getWrapper(sendIq(OCCUPANT1_JID, ROOM2_JID, SET, "id1",
                NamespaceURIs.XEP0045_MUC_ADMIN, new IqAdminItem("Nick 2", Role.Moderator)));
       
        assertIqResultStanza(ROOM2_JID, OCCUPANT1_JID, "id1", result);

        assertEquals(Role.Moderator, room.findOccupantByNick("Nick 2").getRole());

        // verify that remaining users got presence
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT2_JID, null,
                new MucUserItem(null, null, Affiliation.None, Role.Moderator), null, occupant2Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT1_JID, null,
View Full Code Here

        // 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.Visitor)));
        assertIqResultStanza(ROOM2_JID, OCCUPANT1_JID, "id1", result);

        assertEquals(Role.Visitor, room.findOccupantByNick("Nick 2").getRole());

        // verify that remaining users got presence
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT2_JID, null,
                new MucUserItem(null, null, Affiliation.Member, Role.Visitor), null, occupant2Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT1_JID, null,
View Full Code Here

        IQStanza result = (IQStanza) IQStanza.getWrapper(sendIq(OCCUPANT1_JID, ROOM2_JID, SET, "id1",
                NamespaceURIs.XEP0045_MUC_ADMIN, new IqAdminItem("Nick 2", Affiliation.Owner)));
       
        assertIqResultStanza(ROOM2_JID, OCCUPANT1_JID, "id1", result);

        assertEquals(Affiliation.Owner, room.findOccupantByNick("Nick 2").getAffiliation());

        // verify that remaining users got presence
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT2_JID, null,
                new MucUserItem(null, null, Affiliation.Owner, Role.Visitor), null, occupant2Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT1_JID, null,
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.