Package org.apache.http.nio.protocol

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


    }

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

        File tmpdir = FileUtils.getTempDirectory();
        this.tmpfile = new File(tmpdir, "dst.test");
        TestZeroCopyPost httppost = new TestZeroCopyPost(target.toURI() + "/bounce", false);
View Full Code Here


    }

    @Test
    public void testZeroCopyFallback() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(new TestHandler(true)));
        HttpHost target = start(registry, null);
        File tmpdir = FileUtils.getTempDirectory();
        this.tmpfile = new File(tmpdir, "dst.test");
        TestZeroCopyPost httppost = new TestZeroCopyPost(target.toURI() + "/bounce", true);
        TestZeroCopyConsumer consumer = new TestZeroCopyConsumer(this.tmpfile);
View Full Code Here

        return target;
    }

    private HttpHost start() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("/echo/*", new BufferingAsyncRequestHandler(new EchoHandler()));
        registry.register("/random/*", new BufferingAsyncRequestHandler(new RandomHandler()));
        return start(registry, null);
    }
View Full Code Here

    }

    @Test
    public void testBasicRedirect300() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(
                new BasicRedirectService(getSchemeName(), HttpStatus.SC_MULTIPLE_CHOICES)));
        HttpHost target = start(registry, null);

        HttpContext context = new BasicHttpContext();

View Full Code Here

    }

    @Test
    public void testBasicRedirect301() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(
                new BasicRedirectService(getSchemeName(), HttpStatus.SC_MOVED_PERMANENTLY)));
        HttpHost target = start(registry, null);

        HttpContext context = new BasicHttpContext();

View Full Code Here

    }

    @Test
    public void testBasicRedirect302() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(
                new BasicRedirectService(getSchemeName(), HttpStatus.SC_MOVED_TEMPORARILY)));
        HttpHost target = start(registry, null);

        HttpContext context = new BasicHttpContext();

View Full Code Here

    }

    @Test
    public void testBasicRedirect302NoLocation() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(new HttpRequestHandler() {

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

    }

    @Test
    public void testBasicRedirect303() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(
                new BasicRedirectService(getSchemeName(), HttpStatus.SC_SEE_OTHER)));
        HttpHost target = start(registry, null);

        HttpContext context = new BasicHttpContext();

View Full Code Here

    }

    @Test
    public void testBasicRedirect304() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(
                new BasicRedirectService(getSchemeName(), HttpStatus.SC_NOT_MODIFIED)));
        HttpHost target = start(registry, null);

        HttpContext context = new BasicHttpContext();

View Full Code Here

    }

    @Test
    public void testBasicRedirect305() throws Exception {
        HttpAsyncRequestHandlerRegistry registry = new HttpAsyncRequestHandlerRegistry();
        registry.register("*", new BufferingAsyncRequestHandler(
                new BasicRedirectService(getSchemeName(), HttpStatus.SC_USE_PROXY)));
        HttpHost target = start(registry, null);

        HttpContext context = new BasicHttpContext();

View Full Code Here

TOP

Related Classes of org.apache.http.nio.protocol.BufferingAsyncRequestHandler

Copyright © 2018 www.massapicom. 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.