Examples of UriHttpAsyncRequestHandlerMapper


Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

    }

    @Test
    public void testTruncatedChunkException() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler(true)));
        this.server.start(registry);
        this.client.start();

        final ListenerEndpoint endpoint = this.server.getListenerEndpoint();
        endpoint.waitFor();
View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

    }

    @Test
    public void testIgnoreTruncatedChunkException() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler(true)));
        this.server.start(registry);
        this.client.start();

        final ListenerEndpoint endpoint = this.server.getListenerEndpoint();
        endpoint.waitFor();
View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

                        new ClientConnectionFactory(
                                SSLTestContexts.createClientSSLContext()), null));
        this.client.setExceptionHandler(new SimpleIOReactorExceptionHandler());
        this.client.setTimeout(5000);

        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(requestHandler));

        this.server.start(HttpServerNio.DEFAULT_HTTP_PROC, registry, null);
        this.client.start(HttpClientNio.DEFAULT_HTTP_PROC);

        final ListenerEndpoint endpoint = this.server.getListenerEndpoint();
View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

        return buffer.toString();
    }

    @Test
    public void testHttpGets() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        final HttpHost target = start(registry, null);

        this.client.setMaxPerRoute(3);
        this.client.setMaxTotal(3);

View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

        }
    }

    @Test
    public void testHttpHeads() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        final HttpHost target = start(registry, null);

        this.client.setMaxPerRoute(3);
        this.client.setMaxTotal(3);

View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

        }
    }

    @Test
    public void testHttpPosts() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        final HttpHost target = start(registry, null);

        this.client.setMaxPerRoute(3);
        this.client.setMaxTotal(3);

View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

                }.start();
            }

        }

        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new DelayedRequestHandler());
        final HttpHost target = start(registry, null);

        this.client.setMaxPerRoute(3);
        this.client.setMaxTotal(3);

View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

        return (InetSocketAddress) endpoint.getAddress();
    }

    @Test
    public void testConnectionTerminatedProcessingRequest() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new HttpAsyncRequestHandler<HttpRequest>() {

            @Override
            public HttpAsyncRequestConsumer<HttpRequest> processRequest(
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

        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 {
View Full Code Here

Examples of org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper

        Assert.assertTrue(responseStreamClosed.await(5, TimeUnit.SECONDS));
    }

    @Test
    public void testConnectionTerminatedSendingResponse() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new HttpAsyncRequestHandler<HttpRequest>() {

            @Override
            public HttpAsyncRequestConsumer<HttpRequest> processRequest(
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.