Package org.apache.camel.component.http4.helper

Examples of org.apache.camel.component.http4.helper.HttpProducerHelper


*/
public class HttpProducerSelectMethodTest extends BaseHttpTest {

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

        HttpComponent component = context.getComponent("http4", HttpComponent.class);
       
        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here


        assertExchange(exchange);
    }

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

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        assertExchange(exchange);
    }

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

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        producer.stop();
    }

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

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        producer.stop();
    }

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

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort() + "?q=Camel");
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        producer.stop();
    }

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

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        producer.stop();
    }
   
    @Test
    public void withHttpURIInHeader() throws Exception {
        localServer.register("/", new BasicValidationHandler("GET", "q=Camel", null, getExpectedContent()));

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort());
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        producer.stop();
    }

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

        HttpComponent component = context.getComponent("http4", HttpComponent.class);

        HttpEndpoint endpoiont = (HttpEndpoint) component.createEndpoint("http4://" + getHostName() + ":" + getPort() + "?q=Donkey");
        HttpProducer producer = new HttpProducer(endpoiont);
View Full Code Here

        assertExchange(exchange);
    }

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

        assertExchange(exchange);
    }

    @Override
    protected void registerHandler(LocalTestServer server) {
        server.register("/", new BasicValidationHandler("GET", "hl=en&q=camel", null, getExpectedContent()));
        server.register("/test/", new BasicValidationHandler("GET", "my=@+camel", null, getExpectedContent()));
        server.register("/user/pass", new BasicValidationHandler("GET", "password=baa&username=foo", null, getExpectedContent()));
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.http4.helper.HttpProducerHelper

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.