use of com.navercorp.pinpoint.rpc.util.PinpointRPCTestUtils.EchoClientListener in project pinpoint by naver.
the class ClientMessageListenerTest method clientMessageListenerTest1.
@Test
public void clientMessageListenerTest1() {
TestPinpointServerAcceptor testPinpointServerAcceptor = new TestPinpointServerAcceptor(testServerMessageListenerFactory);
int bindPort = testPinpointServerAcceptor.bind();
EchoClientListener echoMessageListener = new EchoClientListener();
TestPinpointClient testPinpointClient = new TestPinpointClient(echoMessageListener, PinpointRPCTestUtils.getParams());
try {
testPinpointClient.connect(bindPort);
testPinpointServerAcceptor.assertAwaitClientConnected(1, 1000);
PinpointSocket writableServer = testPinpointServerAcceptor.getConnectedPinpointSocketList().get(0);
assertSendMessage(writableServer, "simple", echoMessageListener);
assertRequestMessage(writableServer, "request", echoMessageListener);
} finally {
testPinpointClient.closeAll();
testPinpointServerAcceptor.close();
}
}
Aggregations