Package com.calclab.emite.im.chat

Examples of com.calclab.emite.im.chat.Chat


public class PairChatManagerTests extends AbstractChatManagerTests {

  @Test
  public void shouldBeInitiatedByOtherIfMessageArrives() {
    session.receives(new Message("body", ME, OTHER));
    final Chat chat = manager.open(uri("someone@domain"));
    assertFalse(chat.isInitiatedByMe());
  }
View Full Code Here


    assertFalse(chat.isInitiatedByMe());
  }

  @Test
  public void shouldForwardMessagesToChats() {
    final Chat chat = manager.open(OTHER);
    final MessageReceivedTestHandler handler = new MessageReceivedTestHandler();
    chat.addMessageReceivedHandler(handler);
    session.receives(new Message("body", ME, OTHER));
    assertEquals(1, handler.getCalledTimes());
    session.receives("<message type='chat' id='purplee8b92642' to='me@localhost' " + "from='other@localhost'><x xmlns='jabber:x:event'/><active"
        + "xmlns='http://jabber.org/protocol/chatstates'/></message>");
    assertEquals(2, handler.getCalledTimes());
View Full Code Here

  }

  @Test
  public void shouldOpenChatWhenLogin() {
    session.logout();
    final Chat chat = manager.open(OTHER);
    assertEquals(ChatStatus.locked, chat.getStatus());
    session.setLoggedIn(ME);
    assertEquals(ChatStatus.ready, chat.getStatus());
  }
View Full Code Here

  }

  @Test
  public void shouldReturnLockedChatsIfNotLoggedIn() {
    session.logout();
    final Chat chat = manager.open(OTHER);
    assertEquals(ChatStatus.locked, chat.getStatus());
  }
View Full Code Here

  }

  @Test
  public void shouldReturnReadyChatsIfLoggedIn() {
    session.login(ME, "");
    final Chat chat = manager.open(OTHER);
    assertEquals(ChatStatus.ready, chat.getStatus());
  }
View Full Code Here

TOP

Related Classes of com.calclab.emite.im.chat.Chat

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.