use of com.navercorp.pinpoint.rpc.server.LoggingServerMessageListenerFactory in project pinpoint by naver.
the class TcpDataSenderReconnectTest method connectAndSend.
@Test
public void connectAndSend() throws InterruptedException {
TestPinpointServerAcceptor oldTestPinpointServerAcceptor = new TestPinpointServerAcceptor(new LoggingServerMessageListenerFactory(true));
int bindPort = oldTestPinpointServerAcceptor.bind();
PinpointClientFactory clientFactory = createPinpointClientFactory();
TcpDataSender sender = new TcpDataSender(this.getClass().getName(), TestPinpointServerAcceptor.LOCALHOST, bindPort, clientFactory);
oldTestPinpointServerAcceptor.assertAwaitClientConnected(5000);
oldTestPinpointServerAcceptor.close();
waitClientDisconnected(sender);
logger.debug("Server start------------------");
TestPinpointServerAcceptor newTestPinpointServerAcceptor = new TestPinpointServerAcceptor(new LoggingServerMessageListenerFactory(true));
newTestPinpointServerAcceptor.bind(bindPort);
newTestPinpointServerAcceptor.assertAwaitClientConnected(5000);
logger.debug("sendMessage------------------");
sender.send(new TApiMetaData("test", System.currentTimeMillis(), 1, "TestApi"));
Thread.sleep(500);
logger.debug("sender stop------------------");
sender.stop();
newTestPinpointServerAcceptor.close();
clientFactory.release();
}
Aggregations