Examples of waitForMessage()


Examples of com.linkedin.databus2.test.container.SimpleObjectCaptureHandler.waitForMessage()

    Channel serverChannel = _dummyServer.getChildChannel(clientAddr);
    ChannelPipeline serverPipeline = serverChannel.getPipeline();
    SimpleObjectCaptureHandler objCapture = (SimpleObjectCaptureHandler)serverPipeline.get("3");

    Assert.assertTrue(objCapture.waitForMessage(1000, 0));
    Object msgObj = objCapture.getMessages().get(0);
    Assert.assertTrue(msgObj instanceof HttpRequest);

    //verify we got a /startSCN call
    HttpRequest msgReq = (HttpRequest)msgObj;
View Full Code Here

Examples of com.linkedin.databus2.test.container.SimpleObjectCaptureHandler.waitForMessage()

    Channel serverChannel = _dummyServer.getChildChannel(clientAddr);
    ChannelPipeline serverPipeline = serverChannel.getPipeline();
    SimpleObjectCaptureHandler objCapture = (SimpleObjectCaptureHandler)serverPipeline.get("3");

    Assert.assertTrue(objCapture.waitForMessage(1000, 0));
    Object msgObj = objCapture.getMessages().get(0);
    Assert.assertTrue(msgObj instanceof HttpRequest);

    HttpRequest msgReq = (HttpRequest)msgObj;
    Assert.assertTrue(msgReq.getUri().startsWith("/sources"))// now has "?protocolVersion=X" appended
View Full Code Here

Examples of com.linkedin.databus2.test.container.SimpleObjectCaptureHandler.waitForMessage()

    Channel serverChannel = _dummyServer.getChildChannel(clientAddr);
    ChannelPipeline serverPipeline = serverChannel.getPipeline();
    SimpleObjectCaptureHandler objCapture = (SimpleObjectCaptureHandler)serverPipeline.get("3");

    Assert.assertTrue(objCapture.waitForMessage(1000, 0));
    Object msgObj = objCapture.getMessages().get(0);
    Assert.assertTrue(msgObj instanceof HttpRequest);

    HttpRequest msgReq = (HttpRequest)msgObj;
    Assert.assertTrue(msgReq.getUri().startsWith("/sources"))// now has "?protocolVersion=X" appended
View Full Code Here

Examples of com.opengamma.transport.CollectingFudgeMessageReceiver.waitForMessage()

        public void run() {
          sender.sendRequest(FudgeContext.EMPTY_MESSAGE, collectingReceiver);
        }
      }.start();
    }
    assertNotNull("Message should be received in 4s timeout", collectingReceiver.waitForMessage(4000L));
    assertNotNull("Message should be received in 4s timeout", collectingReceiver.waitForMessage(4000L));
  }

  @Test(invocationCount = 5, successPercentage = 19)
  public void parallelSendTest_single() throws Exception {
View Full Code Here

Examples of com.opengamma.transport.CollectingFudgeMessageReceiver.waitForMessage()

          sender.sendRequest(FudgeContext.EMPTY_MESSAGE, collectingReceiver);
        }
      }.start();
    }
    assertNotNull("Message should be received in 4s timeout", collectingReceiver.waitForMessage(4000L));
    assertNotNull("Message should be received in 4s timeout", collectingReceiver.waitForMessage(4000L));
  }

  @Test(invocationCount = 5, successPercentage = 19)
  public void parallelSendTest_single() throws Exception {
    final AtomicInteger concurrencyMax = new AtomicInteger(0);
View Full Code Here

Examples of com.opengamma.transport.CollectingFudgeMessageReceiver.waitForMessage()

    client.setPortNumber(server.getPortNumber());
    // connect and send testMessage1, then verify that testMessage2 was sent back
    final CollectingFudgeMessageReceiver clientReceiver = new CollectingFudgeMessageReceiver();
    client.setFudgeMessageReceiver(clientReceiver);
    client.getFudgeMessageSender().send(testMessage1);
    final FudgeMsgEnvelope envelope = clientReceiver.waitForMessage(Timeout.standardTimeoutMillis());
    assertNotNull(envelope);
    assertEquals(testMessage2, envelope.getMessage());
    client.stop();
    server.stop();
  }
View Full Code Here

Examples of com.opengamma.transport.CollectingFudgeMessageReceiver.waitForMessage()

    client.getFudgeMessageSender().send(testMessage1);
    assertTrue(message3Receiver.getMessages().isEmpty());
    client.getFudgeMessageSender().send(testMessage2);
    assertTrue(message3Receiver.getMessages().isEmpty());
    client.getFudgeMessageSender().send(testMessage3);
    final FudgeMsgEnvelope envelope = message3Receiver.waitForMessage(Timeout.standardTimeoutMillis());
    assertNotNull(envelope);
    assertEquals(testMessage3, envelope.getMessage());
    server.stop();
    client.stop();
  }
View Full Code Here

Examples of com.opengamma.transport.CollectingFudgeMessageReceiver.waitForMessage()

    client.getFudgeMessageSender().send(FudgeContext.EMPTY_MESSAGE);
    client.getFudgeMessageSender().send(FudgeContext.EMPTY_MESSAGE);
    client.getFudgeMessageSender().send(FudgeContext.EMPTY_MESSAGE);
    final int[] result = new int[4];
    for (int i = 0; i < 4; i++) {
      final FudgeMsgEnvelope envelope = responses.waitForMessage(Timeout.standardTimeoutMillis() * 2L);
      assertNotNull (envelope);
      result[i] = envelope.getMessage().getInt("foo");
    }
    return result;
  }
View Full Code Here

Examples of com.opengamma.transport.CollectingFudgeMessageReceiver.waitForMessage()

    final SocketFudgeMessageSender sender = new SocketFudgeMessageSender();
    sender.setInetAddress(InetAddress.getLocalHost());
    sender.setPortNumber(server.getPortNumber());
    sender.send(FudgeContext.EMPTY_MESSAGE);
    sender.send(FudgeContext.EMPTY_MESSAGE);
    assertNotNull (receiver.waitForMessage(2000));
    assertNotNull (receiver.waitForMessage(2000));
  }

  public void parallelSendTest_single() throws Exception {
    for (int retry = 0; retry < 3; retry++) {
View Full Code Here

Examples of com.opengamma.transport.CollectingFudgeMessageReceiver.waitForMessage()

    sender.setInetAddress(InetAddress.getLocalHost());
    sender.setPortNumber(server.getPortNumber());
    sender.send(FudgeContext.EMPTY_MESSAGE);
    sender.send(FudgeContext.EMPTY_MESSAGE);
    assertNotNull (receiver.waitForMessage(2000));
    assertNotNull (receiver.waitForMessage(2000));
  }

  public void parallelSendTest_single() throws Exception {
    for (int retry = 0; retry < 3; retry++) {
      try {
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.