Examples of MucUserItem


Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        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,
                new MucUserItem(null, null, Affiliation.Member, Role.Visitor), null, occupant1Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        changeNick(OCCUPANT1_JID, new EntityImpl(ROOM1_JID, "new nick"));

        Occupant occupant = room.findOccupantByJID(OCCUPANT1_JID);
        assertEquals("new nick", occupant.getNick());

        MucUserItem unavailbleItem = new MucUserItem(OCCUPANT1_JID, "new nick", Affiliation.None,
                Role.Participant);
        assertPresenceStanza(new EntityImpl(ROOM1_JID, "nick"), OCCUPANT1_JID, PresenceStanzaType.UNAVAILABLE, Arrays.asList(unavailbleItem),
                Arrays.asList(StatusCode.NEW_NICK, StatusCode.OWN_PRESENCE), occupant1Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM1_JID, "nick"), OCCUPANT2_JID, PresenceStanzaType.UNAVAILABLE, Arrays.asList(unavailbleItem),
                Arrays.asList(StatusCode.NEW_NICK), occupant2Queue.getNext());

        MucUserItem availbleItem = new MucUserItem(OCCUPANT1_JID, null, Affiliation.None,
                Role.Participant);
        assertPresenceStanza(new EntityImpl(ROOM1_JID, "new nick"), OCCUPANT1_JID, null, Arrays.asList(availbleItem),
                Arrays.asList(StatusCode.OWN_PRESENCE), occupant1Queue.getNext());
        assertPresenceStanza(new EntityImpl(ROOM1_JID, "new nick"), OCCUPANT2_JID, null, Arrays.asList(availbleItem),
                null, occupant2Queue.getNext());
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        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());

        // verify that remaining users got presence
        assertPresenceStanza(new EntityImpl(ROOM2_JID, "Nick 2"), OCCUPANT1_JID, PresenceStanzaType.UNAVAILABLE,
                new MucUserItem(null, null, Affiliation.None, Role.None), StatusCode.BEEN_KICKED, occupant1Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        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,
                new MucUserItem(null, null, Affiliation.None, Role.Participant), null, occupant1Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        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,
                new MucUserItem(null, null, Affiliation.None, Role.Moderator), null, occupant1Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        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,
                new MucUserItem(null, null, Affiliation.Owner, Role.Visitor), null, occupant1Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        assertEquals(Affiliation.Owner, room.getAffiliations().getAffiliation(OCCUPANT2_JID));

        // verify that remaining users got presence
        // must be sent from the room
        assertMessageStanza(ROOM2_JID, OCCUPANT1_JID,
                null, new MucUserItem(OCCUPANT2_JID, null, Affiliation.Owner, Role.None), occupant1Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "nick 2");

        assertNull(changeStatus(OCCUPANT1_JID, ROOM1_JID_WITH_NICK, "xa", "Gone"));

        MucUserItem item = new MucUserItem(OCCUPANT1_JID, "nick", Affiliation.None, Role.Participant);
        assertPresenceStanza(ROOM1_JID_WITH_NICK, OCCUPANT1_JID, "xa", "Gone", item, occupant1Queue.getNext());
        assertPresenceStanza(ROOM1_JID_WITH_NICK, OCCUPANT2_JID, "xa", "Gone", item, occupant2Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "nick 2");

        assertNull(changeStatus(OCCUPANT1_JID, ROOM1_JID_WITH_NICK, "xa", null));

        MucUserItem item = new MucUserItem(OCCUPANT1_JID, "nick", Affiliation.None, Role.Participant);
        assertPresenceStanza(ROOM1_JID_WITH_NICK, OCCUPANT1_JID, "xa", null, item, occupant1Queue.getNext());
        assertPresenceStanza(ROOM1_JID_WITH_NICK, OCCUPANT2_JID, "xa", null, item, occupant2Queue.getNext());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.modules.extension.xep0045_muc.stanzas.MucUserItem

        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "nick 2");

        assertNull(changeStatus(OCCUPANT1_JID, ROOM1_JID_WITH_NICK, null, "Gone"));

        MucUserItem item = new MucUserItem(OCCUPANT1_JID, "nick", Affiliation.None, Role.Participant);
        assertPresenceStanza(ROOM1_JID_WITH_NICK, OCCUPANT1_JID, null, "Gone", item, occupant1Queue.getNext());
        assertPresenceStanza(ROOM1_JID_WITH_NICK, OCCUPANT2_JID, null, "Gone", item, occupant2Queue.getNext());
    }
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.