Package org.apache.camel.component.http4.handler

Examples of org.apache.camel.component.http4.handler.BasicValidationHandler


*/
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


        assertEquals(4, exchange.getIn().getHeader(Exchange.REDELIVERY_COUNTER));
    }

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

*/
public class HttpProducerSelectMethodTest extends BaseHttpTest {

    @Override
    protected void registerHandler(LocalTestServer server) {
        localServer.register("/myget", new BasicValidationHandler("GET", null, null, getExpectedContent()));
        localServer.register("/mypost", new BasicValidationHandler("POST", null, null, getExpectedContent()));
        localServer.register("/myget2", new BasicValidationHandler("GET", "q=Camel", null, getExpectedContent()));
    }
View Full Code Here

        assertTrue(cause.getMessage().contains("refused"));
    }

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

*/
public class HttpMethodsTest extends BaseHttpTest {

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

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

        assertExchange(exchange);
    }

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

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

        assertEquals("PATCH method not supported", out.getBody(String.class));
    }

    @Test
    public void httpPatchWithBody() throws Exception {
        localServer.register("/", new BasicValidationHandler("PATCH", null, "rocks camel?", getExpectedContent()));

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

        assertEquals("", out.getBody(String.class));
    }

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

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

        assertExchange(exchange);
    }

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

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

        assertExchange(exchange);
    }

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

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

TOP

Related Classes of org.apache.camel.component.http4.handler.BasicValidationHandler

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.