use of jetbrains.communicator.idea.sendMessage.IncomingLocalMessage 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.idea.sendMessage.IncomingLocalMessage in project intellij-plugins by JetBrains.
the class IDEAFacade method createLocalMessageForIncomingEvent.
@Override
public LocalMessage createLocalMessageForIncomingEvent(TransportEvent event) {
final LocalMessage[] result = new LocalMessage[1];
event.accept(new EventVisitor() {
@SuppressWarnings({ "RefusedBequest" })
@Override
public void visitStacktraceEvent(StacktraceEvent event) {
result[0] = new IncomingStacktraceMessage(event);
}
@SuppressWarnings({ "RefusedBequest" })
@Override
public void visitCodePointerEvent(CodePointerEvent event) {
result[0] = new IncomingCodePointerMessage(event, IDEAFacade.this);
}
@SuppressWarnings({ "RefusedBequest" })
@Override
public void visitMessageEvent(MessageEvent event) {
result[0] = new IncomingLocalMessage(event);
}
});
return result[0];
}
Aggregations