Examples of MockTransport


Examples of jetbrains.communicator.mock.MockTransport

    assertEquals("Should have no problems with nulls", 1, myDispatcher.getPendingMessages(myUser).length);
  }

  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"){});
View Full Code Here

Examples of jetbrains.communicator.mock.MockTransport

    assertSame(localMessage1, pendingMessages[1]);
    assertEquals("", localMessage.getLog());
  }

  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));
View Full Code Here

Examples of jetbrains.communicator.mock.MockTransport

  @Override
  protected void setUp() throws Exception {
    super.setUp();

    myTransport = new MockTransport();

    myFacade = new IDEAFacade();
    myUser = UserImpl.create("user", myTransport.getName());
  }
View Full Code Here

Examples of jetbrains.communicator.mock.MockTransport

    testLinkText("file:4", "file", 3, 3);

  }

  private void testLinkText(String expected, String path, int line1, int line2) {
    CodePointerEvent event = EventFactory.createCodePointerEvent(new MockTransport(), "remoteUser",
           VFile.create(path), line1, 22, line2, 43, "comment");
    IncomingCodePointerMessage message = new IncomingCodePointerMessage(event, null);

    assertEquals("Incorrect link text", expected, message.getLinkText());
  }
View Full Code Here

Examples of jetbrains.communicator.mock.MockTransport

  }

  @Override
  protected void setUp() throws Exception {
    super.setUp();
    myTransport = new MockTransport();
    Pico.getInstance().registerComponentInstance(myTransport);

    myMonitor = new UserActivityMonitor(null);
    myMonitor.setRefreshInterval(100);
    myThread = new Thread(myMonitor, "UserActivityMonitorTest-" + getName());
View Full Code Here

Examples of org.apache.activemq.transport.mock.MockTransport

            });
            connection.start();
        }

        public void failConnection() {
            MockTransport mockTransport = connection.getTransportChannel().narrow(MockTransport.class);
            mockTransport.onException(new IOException("Simulated error"));
        }
View Full Code Here

Examples of org.apache.activemq.transport.mock.MockTransport

        sendMessage(connection2);
    }

    private void createConnectionFailure(Connection connection) throws Exception {
        ActiveMQConnection c = ((PooledConnection)connection).getConnection();
        MockTransport t = (MockTransport)c.getTransportChannel().narrow(MockTransport.class);
        t.onException(new IOException("forcing exception for " + getName() + " to force pool eviction"));
        LOG.info("arranged for failure, chucked exception");
    }
View Full Code Here

Examples of org.apache.activemq.transport.mock.MockTransport

            });
            connection.start();
        }

        public void failConnection() {
            MockTransport mockTransport = connection.getTransportChannel().narrow(MockTransport.class);
            mockTransport.onException(new IOException("Simulated error"));
        }
View Full Code Here

Examples of org.apache.activemq.transport.mock.MockTransport

       
        final CountDownLatch publishDone = new CountDownLatch(1);
       
        // The MockTransport is on the remote connection.
        // Slip in a new transport filter after the MockTransport
        MockTransport mt = (MockTransport) connection3.getTransport().narrow(MockTransport.class);
        mt.install(new TransportFilter(mt.getNext()) {
            public void oneway(Object command) throws IOException {
                log.info("Dropping: "+command);
                // just eat it! to simulate a recent failure.
            }
        });
View Full Code Here

Examples of org.apache.activemq.transport.mock.MockTransport

        }});
      connection.start();
    }
   
      public void failConnection() {
      MockTransport mockTransport = (MockTransport)connection.getTransportChannel().narrow(MockTransport.class);
        mockTransport.onException(new IOException("Simulated error"));
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.