use of jetbrains.communicator.core.transport.TransportEvent in project intellij-plugins by JetBrains.
the class UserListComponentTest method testExpandGroupMessageReceived.
public void testExpandGroupMessageReceived() throws Exception {
MockTransport transport = new MockTransport();
User user = UserImpl.create("nick", transport.getName());
user.setGroup("some non-default group", myUserModel);
myUserModel.addUser(user);
TreeUtils.collapseAll(getTree());
assertEquals("Sanity check", 1, getTree().getRowCount());
myBroadcaster.fireEvent(new TransportEvent(transport, "nick") {
});
assertEquals("User group should be expanded to show incoming message icon", 2, getTree().getRowCount());
}
use of jetbrains.communicator.core.transport.TransportEvent in project intellij-plugins by JetBrains.
the class IDEAFacadeTest method testCreateLocalMessage_IncomingMessage.
public void testCreateLocalMessage_IncomingMessage() throws Exception {
TransportEvent event = EventFactory.createMessageEvent(myTransport, "user", "comment123");
Date when = new Date();
event.setWhen(when.getTime());
LocalMessage localMessage = myFacade.createLocalMessageForIncomingEvent(event);
assertTrue("instance of Stacktracelocalmessage expected:" + localMessage.getClass().getName(), localMessage instanceof IncomingLocalMessage);
assertEquals("comment123", ((BaseLocalMessage) localMessage).getComment());
assertEquals(when, localMessage.getWhen());
}
use of jetbrains.communicator.core.transport.TransportEvent in project intellij-plugins by JetBrains.
the class IDEAFacadeTest method testCreateLocalMessage_Stacktrace.
public void testCreateLocalMessage_Stacktrace() throws Exception {
TransportEvent event = EventFactory.createStacktraceEvent(myTransport, "user", "stacktrace", "comment123");
LocalMessage localMessage = myFacade.createLocalMessageForIncomingEvent(event);
assertTrue("instance of Stacktracelocalmessage expected", localMessage instanceof IncomingStacktraceMessage);
assertEquals("comment123", ((BaseLocalMessage) localMessage).getComment());
}
use of jetbrains.communicator.core.transport.TransportEvent in project intellij-plugins by JetBrains.
the class LocalMessageDispatcherTest method testTransportEvent.
public void testTransportEvent() throws Exception {
MockTransport mockTransport = new MockTransport();
MockMessage localMessage = new MockMessage();
MockMessage localMessage1 = new MockMessage();
myIdeFacade.setReturnedMessage(localMessage);
getBroadcaster().fireEvent(new TransportEvent(mockTransport, "user") {
});
myIdeFacade.setReturnedMessage(localMessage1);
getBroadcaster().fireEvent(new TransportEvent(mockTransport, "user") {
});
Message[] pendingMessages = myDispatcher.getPendingMessages(myUser);
assertEquals("Expect a local localMessages as a result to TransportEvent", 2, pendingMessages.length);
assertSame(localMessage, pendingMessages[0]);
assertSame(localMessage1, pendingMessages[1]);
assertEquals("", localMessage.getLog());
}
use of jetbrains.communicator.core.transport.TransportEvent in project intellij-plugins by JetBrains.
the class IDEAFacadeTest method testCreateLocalMessage_CodeInterval.
public void testCreateLocalMessage_CodeInterval() throws Exception {
TransportEvent event = EventFactory.createCodePointerEvent(myTransport, "user22", VFile.create("a path"), 0, 0, 1, 2, "some comment1");
LocalMessage localMessage = myFacade.createLocalMessageForIncomingEvent(event);
assertTrue("instance of IncomingCodePointerMessage expected:" + localMessage, localMessage instanceof IncomingCodePointerMessage);
assertEquals("some comment1", ((BaseLocalMessage) localMessage).getComment());
}
Aggregations