}
}
};
CountingEventListener serverEventListener = new CountingEventListener();
CountingEventListener clientEventListener = new CountingEventListener();
NHttpServiceHandler serviceHandler = createHttpServiceHandler(
requestHandler,
null,
serverEventListener);
NHttpClientHandler clientHandler = createHttpClientHandler(
requestExecutionHandler,
clientEventListener);
this.server.start(serviceHandler);
this.client.start(clientHandler);
InetSocketAddress serverAddress = (InetSocketAddress) this.server.getSocketAddress();
for (int i = 0; i < responseData.length; i++) {
this.client.openConnection(
new InetSocketAddress("localhost", serverAddress.getPort()),
responseData[i]);
}
clientEventListener.await(connNo, 1000);
assertEquals(connNo, clientEventListener.getConnCount());
this.client.shutdown();
this.server.shutdown();
for (int c = 0; c < responseData.length; c++) {