Search in sources :

Example 1 with IncomingStacktraceMessage

use of jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage 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());
}
Also used : TransportEvent(jetbrains.communicator.core.transport.TransportEvent) IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) IncomingStacktraceMessage(jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage)

Example 2 with IncomingStacktraceMessage

use of jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage 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];
}
Also used : LocalMessage(jetbrains.communicator.core.dispatcher.LocalMessage) IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) IncomingCodePointerMessage(jetbrains.communicator.idea.codePointer.IncomingCodePointerMessage) EventVisitor(jetbrains.communicator.core.EventVisitor) MessageEvent(jetbrains.communicator.core.transport.MessageEvent) StacktraceEvent(jetbrains.communicator.core.transport.StacktraceEvent) CodePointerEvent(jetbrains.communicator.core.transport.CodePointerEvent) IncomingLocalMessage(jetbrains.communicator.idea.sendMessage.IncomingLocalMessage) IncomingStacktraceMessage(jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage)

Aggregations

LocalMessage (jetbrains.communicator.core.dispatcher.LocalMessage)2 IncomingLocalMessage (jetbrains.communicator.idea.sendMessage.IncomingLocalMessage)2 IncomingStacktraceMessage (jetbrains.communicator.idea.sendMessage.IncomingStacktraceMessage)2 EventVisitor (jetbrains.communicator.core.EventVisitor)1 CodePointerEvent (jetbrains.communicator.core.transport.CodePointerEvent)1 MessageEvent (jetbrains.communicator.core.transport.MessageEvent)1 StacktraceEvent (jetbrains.communicator.core.transport.StacktraceEvent)1 TransportEvent (jetbrains.communicator.core.transport.TransportEvent)1 IncomingCodePointerMessage (jetbrains.communicator.idea.codePointer.IncomingCodePointerMessage)1