Examples of UriHttpAsyncRequestHandlerMapper


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

        }
    }

    @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

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

    }

    @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

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

        Assert.assertEquals("test realm", authscope.getRealm());
    }

    @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

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

        Assert.assertEquals("test realm", authscope.getRealm());
    }

    @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

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

        Assert.assertEquals("test realm", authscope.getRealm());
    }

    @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

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

        Assert.assertEquals("test realm", authscope.getRealm());
    }

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

        final TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                new UsernamePasswordCredentials("test", "test"));

View Full Code Here

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

        Assert.assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
    }

    @Test(expected=ExecutionException.class)
    public void testBasicAuthenticationFailureWithNonRepeatableEntityExpectContinueOff() 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()
View Full Code Here

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

        }
    }

    @Test
    public void testBasicAuthenticationSuccessOnRepeatablePost() 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()
View Full Code Here

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

        Assert.assertEquals("test realm", authscope.getRealm());
    }

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

        final BasicCredentialsProvider credsProvider = new BasicCredentialsProvider();
        credsProvider.setCredentials(AuthScope.ANY,
                new UsernamePasswordCredentials("test", "test"));

View Full Code Here

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

        Assert.assertEquals(1, authStrategy.getCount());
    }

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

        this.httpclient = HttpAsyncClients.custom()
            .setConnectionManager(this.connMgr)
            .build();

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.