Beispiel #1
0
  @Test
  public void chatStateDontFireOnChatCreatedButMustAfterOpenChat() {
    final Message message = new Message(null, MYSELF, OTHER);
    message.addChild("gone", ChatStateManager.XMLNS);

    final ChatChangedTestHandler handler = addChatCreatedHandler();
    session.receives(message);
    assertTrue(handler.isNotCalled());
    manager.open(OTHER);
    assertTrue(handler.isCalled());
  }
Beispiel #2
0
 @Test
 public void roomInvitationsShouldDontFireOnChatCreatedButMustAfterOpenChat() {
   final ChatChangedTestHandler handler = addChatCreatedHandler();
   session.receives(
       "<message to='"
           + MYSELF
           + "' from='someroom@domain'><x xmlns='http://jabber.org/protocol/muc#user'>"
           + "<invite from='"
           + OTHER
           + "'><reason>Join to our conversation</reason></invite>"
           + "</x><x jid='someroom@domain' xmlns='jabber:x:conference' /></message>");
   assertTrue(handler.isNotCalled());
   manager.open(OTHER);
   assertTrue(handler.isCalled());
 }