Package org.apache.camel.component.http4

Examples of org.apache.camel.component.http4.BasicAuthenticationHttpClientConfigurer


    @Test
    public void httpHandleRedirect() throws Exception {
        // force a 301 redirect
        localServer.register("/test", new RedirectHandler(HttpStatus.SC_MOVED_PERMANENTLY));
        localServer.register("/someplaceelse", new BasicValidationHandler("GET", null, null, "Bye World"));

        String uri = "http4://" + getHostName() + ":" + getPort()
                + "/test?httpClient.soTimeout=60000&httpClient.connectionTimeout=60000"
                + "&httpClient.staleCheckingEnabled=false";
        Exchange out = template.request(uri, new Processor() {
View Full Code Here


*/
public class HttpWithHttpUriHeaderTest extends BaseHttpTest {

    @Test
    public void notBridgeEndpointWithDefault() throws Exception {
        localServer.register("/", new BasicValidationHandler("GET", null, null, getExpectedContent()));

        Exchange exchange = template.request("http4://host/", new Processor() {
            public void process(Exchange exchange) throws Exception {
                exchange.getIn().setHeader(Exchange.HTTP_URI, "http4://" + getHostName() + ":" + getPort() + "/");
            }
View Full Code Here

        assertExchange(exchange);
    }

    @Override
    protected void registerHandler(LocalTestServer server) {
        server.register("/", new BasicValidationHandler("POST", null, getBody(), getExpectedContent()));
    }
View Full Code Here

        return registry;
    }

    @Test
    public void httpsGet() throws Exception {
        localServer.register("/mail/", new BasicValidationHandler("GET", null, null, getExpectedContent()));

        Exchange exchange = template.request("https4://127.0.0.1:" + getPort() + "/mail/?x509HostnameVerifier=x509HostnameVerifier", new Processor() {
            public void process(Exchange exchange) throws Exception {
            }
        });
View Full Code Here

        }
    }

    @Override
    protected void registerHandler(LocalTestServer server) {
        server.register("/", new DelayValidationHandler("GET", null, null, getExpectedContent(), 1000));
    }
View Full Code Here

        }
    }

    @Override
    protected void registerHandler(LocalTestServer server) {
        server.register("/", new DelayValidationHandler("GET", null, null, getExpectedContent(), 2000));
    }
View Full Code Here

        }
    }

    @Override
    protected void registerHandler(LocalTestServer server) {
        server.register("/", new DelayValidationHandler("GET", null, null, getExpectedContent(), 1000));
    }
View Full Code Here

    @Test
    public void httpGetWithProxyAndWithoutUser() throws Exception {
        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");
        proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

        Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "?proxyHost=" + getProxyHost() + "&proxyPort=" + getProxyPort(), new Processor() {
            public void process(Exchange exchange) throws Exception {
            }
        });
View Full Code Here

        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");

        try {
            proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

            Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort(), new Processor() {
                public void process(Exchange exchange) throws Exception {
                }
            });
View Full Code Here

        Map<String, String> expectedHeaders = new HashMap<String, String>();
        expectedHeaders.put("Host", getHostName() + ":" + getPort());
        expectedHeaders.put("Proxy-Connection", "Keep-Alive");

        try {
            proxy.register("*", new HeaderValidationHandler("GET", null, null, getExpectedContent(), expectedHeaders));

            Exchange exchange = template.request("http4://" + getHostName() + ":" + getPort() + "?proxyHost="
                    + getProxyHost() + "&proxyPort=" + getProxyPort(), new Processor() {
                        public void process(Exchange exchange) throws Exception {
                        }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.http4.BasicAuthenticationHttpClientConfigurer

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.