Package org.apache.camel.component.http

Examples of org.apache.camel.component.http.HttpProducer


    public void testCustomHttpBinding() throws Exception {
        // assert jetty was configured with our timeout
        JettyHttpEndpoint jettyEndpoint = (JettyHttpEndpoint) context.getEndpoint("jetty:http://localhost:8080/myapp/myservice?httpClient.soTimeout=5555");
        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:8080/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: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
        JettyHttpEndpoint jettyEndpoint = (JettyHttpEndpoint) context.getEndpoint("jetty:http://localhost:8080/myapp/myservice?httpClient.soTimeout=5555");
        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

    public void testCustomHttpBinding() throws Exception {
        // assert jetty was configured with our timeout
        JettyHttpEndpoint jettyEndpoint = (JettyHttpEndpoint) context.getEndpoint("jetty:http://localhost:8080/myapp/myservice?httpClient.soTimeout=5555");
        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

TOP

Related Classes of org.apache.camel.component.http.HttpProducer

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.