Package com.calclab.emite.xep.muc

Examples of com.calclab.emite.xep.muc.RoomInvitation


  @Test
  public void shouldAcceptInvitations() {
    final RoomChatChangedTestHandler handler = new RoomChatChangedTestHandler();
    final ChatProperties properties = new ChatProperties(USER);
    manager.addRoomChatChangedHandler(handler);
    final RoomInvitation invitation = new RoomInvitation(uri("friend@host/resource"), uri("room@room.service"), "theReason", properties);
    manager.acceptRoomInvitation(invitation);
    assertEquals(2, handler.getCalledTimes());
    assertEquals(ChangeType.created, handler.getEvent(0).getChangeType());
    assertEquals(ChangeType.opened, handler.getEvent(1).getChangeType());
  }
View Full Code Here


    manager.addRoomChatChangedHandler(chatCreatedHandler);

    final String reason = "theReason";
    final XmppURI invitor = uri("friend@host/resource");
    final XmppURI roomURI = uri("room@room.service");
    manager.acceptRoomInvitation(new RoomInvitation(invitor, roomURI, reason));
    assertTrue(chatCreatedHandler.isCalledOnce());
    final RoomChat room = chatCreatedHandler.getLastChat();
    assertEquals("room@room.service/self", room.getURI().toString());
  }
View Full Code Here

    final XmppURI roomURI = uri("room@room.service");
    final ChatProperties properties = new ChatProperties(roomURI);
    final String testDataKey = "TEST_KEY";
    final String testDataValue = "TEST_VALUE";
    properties.setData(testDataKey, testDataValue);
    manager.acceptRoomInvitation(new RoomInvitation(invitor, roomURI, reason, properties));
    final RoomChat room = chatCreatedHandler.getLastChat();
    assertEquals("Chat property not preserved", testDataValue, room.getProperties().getData(testDataKey));
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.xep.muc.RoomInvitation

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.