Package com.calclab.emite.xtesting.handlers

Examples of com.calclab.emite.xtesting.handlers.ChatStatusChangedTestHandler


    session.verifySent("<presence to='room@domain/nick'><x xmlns='http://jabber.org/protocol/muc' /></presence>");
  }

  @Test
  public void shouldUnlockWhenInstantRoomIsCreated() {
    final ChatStatusChangedTestHandler handler = new ChatStatusChangedTestHandler();
    room.addChatStatusChangedHandler(false, handler);
    assertEquals(ChatStatus.locked, room.getStatus());
    receiveInstantRoomCreation(userURI, roomURI);
    assertTrue(handler.isCalledOnce());
  }
View Full Code Here


    assertEquals(ChatStatus.ready, aChat.getStatus());
  }

  @Test
  public void shouldLockIfLogoutAndUnlockWhenLogginWithSameUser() {
    final ChatStatusChangedTestHandler handler = new ChatStatusChangedTestHandler();
    pairChat.addChatStatusChangedHandler(true, handler);
    assertEquals(ChatStatus.ready, handler.getLastChatStatus());
    session.logout();
    assertEquals(ChatStatus.locked, handler.getLastChatStatus());
    session.login(USER_URI, "");
    assertEquals(ChatStatus.ready, handler.getLastChatStatus());
  }
View Full Code Here

    chat.addMessageSentHandler(sentHandler);
  }

  @Test
  public void shouldFireChatStateChanges() {
    final ChatStatusChangedTestHandler handler = new ChatStatusChangedTestHandler();
    chat.addChatStatusChangedHandler(true, handler);
    assertEquals(1, handler.getCalledTimes());
    chat.setStatus(ChatStatus.locked);
    assertEquals(2, handler.getCalledTimes());
  }
View Full Code Here

  @Test
  public void shouldCloseChatWhenLoggedOut() {
    final PairChat chat = manager.open(uri("name@domain/resouce"));
    assertEquals(ChatStatus.ready, chat.getStatus());
    final ChatStatusChangedTestHandler handler = new ChatStatusChangedTestHandler();
    chat.addChatStatusChangedHandler(false, handler);
    session.logout();
    assertEquals(ChatStatus.locked, handler.getLastChatStatus());
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.xtesting.handlers.ChatStatusChangedTestHandler

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.