Assert.assertTrue(latch.await(5, TimeUnit.SECONDS));
}
@Test
public void testConnectionTerminatedHandlingRequest() throws Exception {
final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
final CountDownLatch responseStreamClosed = new CountDownLatch(1);
final InputStream testInputStream = new ByteArrayInputStream(
"all is well".getBytes(Consts.ASCII)) {
@Override
public void close() throws IOException {
responseStreamClosed.countDown();
super.close();
}
};
registry.register("*", new HttpAsyncRequestHandler<HttpRequest>() {
@Override
public HttpAsyncRequestConsumer<HttpRequest> processRequest(
final HttpRequest request,
final HttpContext context) throws HttpException, IOException {