Examples of UriHttpAsyncRequestHandlerMapper


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

                }.start();
            }

        };

        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new SimpleRequestHandler()));
        final InetSocketAddress address = start(registry, expectationVerifier);

        final BasicHttpEntityEnclosingRequest request1 = new BasicHttpEntityEnclosingRequest(
                "POST", createRequestUri("AAAAA", 10));
        request1.setEntity(new NStringEntity(createExpectedString("AAAAA", 10)));
View Full Code Here

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

                throw new HttpException("Boom");
            }

        }

        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new FailingRequestHandler());
        final InetSocketAddress address = 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 testNoServiceHandler() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        final InetSocketAddress address = 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 testResponseNoContent() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new HttpRequestHandler() {

            public void handle(
                    final HttpRequest request,
                    final HttpResponse response,
                    final HttpContext context) throws HttpException, IOException {
View Full Code Here

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

        return (InetSocketAddress) endpoint.getAddress();
    }

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

            public HttpAsyncRequestConsumer<HttpRequest> processRequest(
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
                final HttpConnection conn = (HttpConnection) context.getAttribute(
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();
        registry.register("*", new HttpAsyncRequestHandler<HttpRequest>() {

            public HttpAsyncRequestConsumer<HttpRequest> processRequest(
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
                return new BasicAsyncRequestConsumer();
View Full Code Here

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

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

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

            public HttpAsyncRequestConsumer<HttpRequest> processRequest(
                    final HttpRequest request,
                    final HttpContext context) throws HttpException, IOException {
                return new BasicAsyncRequestConsumer();
View Full Code Here

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

        }
    }

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

        final File tmpdir = FileUtils.getTempDirectory();
        this.tmpfile = new File(tmpdir, "dst.test");
        final TestZeroCopyPost httppost = new TestZeroCopyPost(target.toURI() + "/bounce", false);
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.