final HttpHost redirectTarget = start(registry, null);
final UriHttpAsyncRequestHandlerMapper registry2 = new UriHttpAsyncRequestHandlerMapper();
registry2.register("/redirect/*", new BasicAsyncRequestHandler(
new CrossSiteRedirectService(redirectTarget)));
final HttpServerNio secondServer = new HttpServerNio(this.serverReactorConfig,
createServerConnectionFactory(this.serverConnectionConfig));
secondServer.setExceptionHandler(new SimpleIOReactorExceptionHandler());
final HttpAsyncService serviceHandler = new HttpAsyncService(
this.serverHttpProc,
new DefaultConnectionReuseStrategy(),
new DefaultHttpResponseFactory(),
registry2,
null);
secondServer.start(serviceHandler);
try {
final ListenerEndpoint endpoint2 = secondServer.getListenerEndpoint();
endpoint2.waitFor();
Assert.assertEquals("Test server status", IOReactorStatus.ACTIVE, secondServer.getStatus());
final InetSocketAddress address2 = (InetSocketAddress) endpoint2.getAddress();
final HttpHost initialTarget = new HttpHost("localhost", address2.getPort(), getSchemeName());
final Queue<Future<HttpResponse>> queue = new ConcurrentLinkedQueue<Future<HttpResponse>>();
for (int i = 0; i < 4; i++) {