Package org.apache.camel.component.http

Examples of org.apache.camel.component.http.HttpEndpoint.createProducer()


    @Test
    public void testCustomHttpBinding() throws Exception {
        // assert jetty was configured with our timeout
        HttpEndpoint jettyEndpoint = context.getEndpoint("http://localhost:8080/myapp/myservice?httpClient.soTimeout=5555", HttpEndpoint.class);
        assertNotNull("Jetty endpoint should not be null ", jettyEndpoint);
        HttpProducer producer = (HttpProducer)jettyEndpoint.createProducer();
        assertEquals("Get the wrong http client parameter", 5555, producer.getHttpClient().getParams().getSoTimeout());

        // send and receive
        Object out = template.requestBody("http://localhost:9080/myapp/myservice", "Hello World");
        assertEquals("Bye World", context.getTypeConverter().convertTo(String.class, out));
View Full Code Here


    @Test
    public void testCustomHttpBinding() throws Exception {
        // assert jetty was configured with our timeout
        HttpEndpoint jettyEndpoint = context.getEndpoint("http://localhost:{{port}}/myapp/myservice?httpClient.soTimeout=5555", HttpEndpoint.class);
        assertNotNull("Jetty endpoint should not be null ", jettyEndpoint);
        HttpProducer producer = (HttpProducer)jettyEndpoint.createProducer();
        assertEquals("Get the wrong http client parameter", 5555, producer.getHttpClient().getParams().getSoTimeout());

        // send and receive
        Object out = template.requestBody("http://localhost:{{port}}/myapp/myservice", "Hello World");
        assertEquals("Bye World", context.getTypeConverter().convertTo(String.class, out));
View Full Code Here

    @Test
    public void testCustomHttpBinding() throws Exception {
        // assert jetty was configured with our timeout
        HttpEndpoint jettyEndpoint = context.getEndpoint("http://localhost:{{port}}/myapp/myservice?httpClient.soTimeout=5555", HttpEndpoint.class);
        assertNotNull("Jetty endpoint should not be null ", jettyEndpoint);
        HttpProducer producer = (HttpProducer)jettyEndpoint.createProducer();
        assertEquals("Get the wrong http client parameter", 5555, producer.getHttpClient().getParams().getSoTimeout());

        // send and receive
        Object out = template.requestBody("http://localhost:{{port}}/myapp/myservice", "Hello World");
        assertEquals("Bye World", context.getTypeConverter().convertTo(String.class, out));
View Full Code Here

    @Test
    public void testProxySettingOfJettyHttpClient() throws Exception {
        // setup the Proxy setting through the URI
        HttpEndpoint jettyEndpoint = context.getEndpoint("jetty://http://localhost:{{port}}/proxy/setting?proxyHost=192.168.0.1&proxyPort=9090", HttpEndpoint.class);
        assertNotNull("Jetty endpoint should not be null ", jettyEndpoint);
        JettyHttpProducer producer = (JettyHttpProducer)jettyEndpoint.createProducer();
        assertEquals("Get the wrong http proxy host parameter", "192.168.0.1", producer.getClient().getProxy().getHost());
        assertEquals("Get the wrong http proxy port paramerter", 9090, producer.getClient().getProxy().getPort());
       
        // setup the context properties
        context.getProperties().put("http.proxyHost", "192.168.0.2");
View Full Code Here

       
        // setup the context properties
        context.getProperties().put("http.proxyHost", "192.168.0.2");
        context.getProperties().put("http.proxyPort", "8080");
        jettyEndpoint = context.getEndpoint("jetty://http://localhost:{{port}}/proxy2/setting", HttpEndpoint.class);
        producer = (JettyHttpProducer)jettyEndpoint.createProducer();
        assertEquals("Get the wrong http proxy host parameter", "192.168.0.2", producer.getClient().getProxy().getHost());
        assertEquals("Get the wrong http proxy port paramerter", 8080, producer.getClient().getProxy().getPort());
        context.getProperties().clear();

    }
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.