Search in sources :

Example 11 with MockTransport

use of jetbrains.communicator.mock.MockTransport in project intellij-plugins by JetBrains.

the class EventsProcessorTest method testIncomingMessage_No_Tab_WithExpand.

public void testIncomingMessage_No_Tab_WithExpand() throws Exception {
    MessageEvent event = EventFactory.createMessageEvent(new MockTransport(), "bob", "text");
    myMock.expects(once()).method("expandToolWindow");
    myMock.expects(once()).method("newMessageAvailable").with(eq(myUserModel.createUser("bob", MockTransport.NAME)), eq(event));
    myMock.expects(once()).method("getWindow").will(returnValue(null));
    getBroadcaster().fireEvent(event);
}
Also used : MessageEvent(jetbrains.communicator.core.transport.MessageEvent) MockTransport(jetbrains.communicator.mock.MockTransport)

Example 12 with MockTransport

use of jetbrains.communicator.mock.MockTransport in project intellij-plugins by JetBrains.

the class CodePointerXmlMessageTest method _test.

private void _test(String text, VFile vFile, CodePointer codePointer) {
    Element root = new Element("element");
    CodePointerXmlMessage xmlMessage = new CodePointerXmlMessage(text, codePointer, vFile);
    xmlMessage.fillRequest(root);
    CodePointerEvent event = CodePointerXmlMessage.createEvent(new MockTransport(), "someUser", root);
    assertEquals("someUser", event.getRemoteUser());
    assertEquals("Wrong code pointer restored", codePointer, event.getCodePointer());
    assertEquals(vFile, event.getFile());
}
Also used : Element(org.jdom.Element) MockTransport(jetbrains.communicator.mock.MockTransport)

Example 13 with MockTransport

use of jetbrains.communicator.mock.MockTransport in project intellij-plugins by JetBrains.

the class UserActivityMonitorTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    myTransport = new MockTransport();
    Pico.getInstance().registerComponentInstance(myTransport);
    myMonitor = new UserActivityMonitor();
    myMonitor.setRefreshInterval(100);
    myThread = new Thread(myMonitor, "UserActivityMonitorTest-" + getName());
}
Also used : MockTransport(jetbrains.communicator.mock.MockTransport)

Aggregations

MockTransport (jetbrains.communicator.mock.MockTransport)13 User (jetbrains.communicator.core.users.User)4 MockMessage (jetbrains.communicator.mock.MockMessage)3 MockUser (jetbrains.communicator.mock.MockUser)3 LocalMessage (jetbrains.communicator.core.dispatcher.LocalMessage)2 MessageEvent (jetbrains.communicator.core.transport.MessageEvent)2 TransportEvent (jetbrains.communicator.core.transport.TransportEvent)2 UserPresence (jetbrains.communicator.core.users.UserPresence)2 Message (jetbrains.communicator.core.dispatcher.Message)1 CodePointerEvent (jetbrains.communicator.core.transport.CodePointerEvent)1 Transport (jetbrains.communicator.core.transport.Transport)1 SendMessageEvent (jetbrains.communicator.ide.SendMessageEvent)1 Element (org.jdom.Element)1