Package org.apache.http.nio.protocol

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


            }

        };

        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


    }

    @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

    }

    @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

    }

    @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

    }

    @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

    }

    @Test
    public void testZeroCopyFallback() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new TestHandler(true)));
        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", true);
        final TestZeroCopyConsumer consumer = new TestZeroCopyConsumer(this.tmpfile);
View Full Code Here

    }

    @Test
    public void testBasicAuthenticationNoCreds() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new AuthHandler()));

        final TestCredentialsProvider credsProvider = new TestCredentialsProvider(null);
        this.httpclient = HttpAsyncClients.custom()
            .setConnectionManager(this.connMgr)
            .setDefaultCredentialsProvider(credsProvider)
View Full Code Here

    }

    @Test
    public void testBasicAuthenticationFailure() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new AuthHandler()));

        final TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                new UsernamePasswordCredentials("test", "all-wrong"));
        this.httpclient = HttpAsyncClients.custom()
            .setConnectionManager(this.connMgr)
View Full Code Here

    }

    @Test
    public void testBasicAuthenticationSuccess() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new AuthHandler()));

        final TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                new UsernamePasswordCredentials("test", "test"));
        this.httpclient = HttpAsyncClients.custom()
            .setConnectionManager(this.connMgr)
View Full Code Here

    }

    @Test
    public void testBasicAuthenticationSuccessNonPersistentConnection() throws Exception {
        final UriHttpAsyncRequestHandlerMapper registry = new UriHttpAsyncRequestHandlerMapper();
        registry.register("*", new BasicAsyncRequestHandler(new AuthHandler(false)));

        final TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                new UsernamePasswordCredentials("test", "test"));
        this.httpclient = HttpAsyncClients.custom()
            .setConnectionManager(this.connMgr)
View Full Code Here

TOP

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

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.