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

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


        testNotAllowedMessage(room, StanzaErrorCondition.FORBIDDEN);
    }

    public void testMessageUserNotOccupant() throws Exception {
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        // do not add user to room

        testNotAllowedMessage(room, StanzaErrorCondition.NOT_ACCEPTABLE);
    }
View Full Code Here


    public void testMessageToRoomWithRelays() throws Exception {
        String body = "Message body";

        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "Nick 2");

        // send message to room
        sendMessage(OCCUPANT1_JID, ROOM1_JID, GROUPCHAT, body);

        // verify stanzas to existing occupants on the exiting user
View Full Code Here

    public void testMessageToOccupant() throws Exception {
        String body = "Message body";

        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "Nick 2");

        // send message to occupant 1
        sendMessage(OCCUPANT1_JID, new EntityImpl(ROOM1_JID, "Nick 2"), MessageStanzaType.CHAT, body);

        // verify stanzas to existing occupants on the exiting user
View Full Code Here

        assertNull(occupant1Queue.getNext());
    }

    public void testGroupChatMessageToOccupant() throws Exception {
        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.addOccupant(OCCUPANT1_JID, "nick");
        room.addOccupant(OCCUPANT2_JID, "Nick 2");

        // send message to occupant 1 with type groupchat
        Stanza errorStanza = sendMessage(OCCUPANT1_JID, new EntityImpl(ROOM1_JID, "Nick 2"),
                MessageStanzaType.GROUPCHAT, BODY);
View Full Code Here

    public void testInviteMessageWithPassword() throws Exception {
        String reason = "Join me!";

        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.setPassword("secret");
        room.addOccupant(OCCUPANT1_JID, "nick");

        Invite invite = new Invite(null, OCCUPANT2_JID, reason);
        // send message to occupant 1
        assertNull(sendMessage(OCCUPANT1_JID, ROOM1_JID, null, null, new X(NamespaceURIs.XEP0045_MUC_USER, invite), null));
View Full Code Here

    public void testDeclineMessage() throws Exception {
        String reason = "No way";

        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.addOccupant(OCCUPANT2_JID, "nick");

        Decline decline = new Decline(null, OCCUPANT2_JID, reason);
        // send message to occupant 1
        Stanza error = sendMessage(OCCUPANT1_JID, ROOM1_JID, null, null, new X(NamespaceURIs.XEP0045_MUC_USER, decline), null);
        assertNull(error);
View Full Code Here

    protected StanzaHandler createHandler() {
        return new MUCPresenceHandler(conference);
    }

    public void testExitRoom() throws Exception {
        Room room = conference.findRoom(ROOM1_JID);
        room.addOccupant(OCCUPANT1_JID, "Nick1");
        room.addOccupant(OCCUPANT2_JID, "Nick2");

        assertNull(exitRoom(OCCUPANT1_JID, ROOM1_JID_WITH_NICK));

        assertEquals(1, room.getOccupantCount());
        Occupant occupant = room.getOccupants().iterator().next();

        assertEquals(OCCUPANT2_JID, occupant.getJid());
    }
View Full Code Here

        assertNull(exitRoom(OCCUPANT1_JID, ROOM1_JID_WITH_NICK));
    }

    public void testTemporaryRoomDeleted() throws Exception {
        // Room1 is temporary
        Room room = conference.findRoom(ROOM1_JID);
        assertTrue(room.isRoomType(RoomType.Temporary));
        room.addOccupant(OCCUPANT1_JID, "Nick1");

        // exit room, room should be deleted
        assertNull(exitRoom(OCCUPANT1_JID, ROOM1_JID_WITH_NICK));
        assertNull(conference.findRoom(ROOM1_JID));
    }
View Full Code Here

        assertNull(conference.findRoom(ROOM1_JID));
    }

    public void testPersistentRoomNotDeleted() throws Exception {
        // Room2 is persistent
        Room room = conference.createRoom(ROOM2_JID, "Room 2", RoomType.Persistent);
        room.addOccupant(OCCUPANT1_JID, "Nick1");

        // exit room, room should be deleted
        assertNull(exitRoom(OCCUPANT1_JID, ROOM1_JID_WITH_NICK));
        assertNotNull(conference.findRoom(ROOM1_JID));
    }
View Full Code Here

        assertNotNull(conference.findRoom(ROOM1_JID));
    }

    public void testExitRoomWithRelays() throws Exception {
        // add occupants to the room
        Room room = conference.findOrCreateRoom(ROOM1_JID, "Room 1");
        room.addOccupant(OCCUPANT1_JID, "Nick 1");
        room.addOccupant(OCCUPANT2_JID, "Nick 2");

        // now, let user 1 exit room
        exitRoom(OCCUPANT1_JID, ROOM1_JID_WITH_NICK);

        // verify stanzas to existing occupants on the exiting user
View Full Code Here

TOP

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

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.