Search in sources :

Example 1 with SendMessageEvent

use of jetbrains.communicator.ide.SendMessageEvent in project intellij-plugins by JetBrains.

the class LocalMessageDispatcherTest method testSendMessageEvent.

public void testSendMessageEvent() throws Exception {
    MockTransport mockTransport = new MockTransport();
    MockMessage localMessage = new MockMessage();
    MockMessage localMessage1 = new MockMessage();
    myIdeFacade.setReturnedMessage(localMessage);
    getBroadcaster().fireEvent(new SendMessageEvent("text", myUser));
    myIdeFacade.setReturnedMessage(localMessage1);
    getBroadcaster().fireEvent(new SendMessageEvent("text", myUser));
    LocalMessage[] history = myDispatcher.getHistory(myUser, null);
    assertEquals("Expect localMessages as a result to OwnMessageEvent", 2, history.length);
    assertSame(localMessage, history[0]);
    assertSame(localMessage1, history[1]);
}
Also used : LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) MockTransport(jetbrains.communicator.mock.MockTransport) MockMessage(jetbrains.communicator.mock.MockMessage) SendMessageEvent(jetbrains.communicator.ide.SendMessageEvent)

Example 2 with SendMessageEvent

use of jetbrains.communicator.ide.SendMessageEvent in project intellij-plugins by JetBrains.

the class IDEAFacadeTest method testCreateLocalMessage_OutgoingMessage.

public void testCreateLocalMessage_OutgoingMessage() throws Exception {
    LocalMessage outgoingEvent = myFacade.createLocalMessageForOutgoingEvent(new SendMessageEvent("message", myUser));
    assertTrue(outgoingEvent instanceof OutgoingLocalMessage);
}
Also used : IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) SendMessageEvent(jetbrains.communicator.ide.SendMessageEvent)

Aggregations

LocalMessage (jetbrains.communicator.core.dispatcher.LocalMessage)2 SendMessageEvent (jetbrains.communicator.ide.SendMessageEvent)2 IncomingLocalMessage (jetbrains.communicator.idea.sendMessage.IncomingLocalMessage)1 MockMessage (jetbrains.communicator.mock.MockMessage)1 MockTransport (jetbrains.communicator.mock.MockTransport)1