Package org.apache.camel.builder

Examples of org.apache.camel.builder.AdviceWithRouteBuilder


        assertMockEndpointsSatisfied();
    }

    public void testAdviceWithInterceptSendToEndpoint() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("mock:result").to("mock:to");
            }
        });
View Full Code Here


        assertMockEndpointsSatisfied();
    }

    public void testAdviceWithOnCompletion() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                onCompletion().to("mock:done");
            }
        });
View Full Code Here

        INIT.set(true);
    }

    private void replaceFromEndpoints() throws Exception {
        for (final Map.Entry<String, String> entry : fromEndpoints.entrySet()) {
            context.getRouteDefinition(entry.getKey()).adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    replaceFromWith(entry.getValue());
                }
            });
View Full Code Here

        return new ClassPathXmlApplicationContext("org/apache/camel/spring/issues/AdviceWithTransactionIssueTest.xml");
    }

    @Test
    public void testAdviceWithWeaveById() throws Exception {
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                weaveById("mock-b*").after().to("mock:last");
            }
        });
View Full Code Here

        assertMockEndpointsSatisfied();
    }

    @Test
    public void testAdviceWithAddLast() throws Exception {
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                weaveAddLast().to("mock:last");
            }
        });
View Full Code Here

                        .to(provider)
                        .to("mock:result");
            }
        });

        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("http4:fakeHTTPADDRESS.com:80*")
                        .skipSendToOriginalEndpoint()
                        .process(new Processor() {
View Full Code Here

        return true;
    }

    @Test
    public void testTransactionSuccess() throws Exception {
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                onException(AssertionError.class).to("log:error", "mock:error");
            }
        });
View Full Code Here

*/
public class AdviceWithCBRTest extends ContextTestSupport {

    public void testAdviceCBR() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                weaveById("foo").after().to("mock:foo2");
                weaveById("bar").after().to("mock:bar2");
            }
View Full Code Here

        assertMockEndpointsSatisfied();
    }

    public void testAdviceToStringCBR() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                weaveByToString("To[mock:foo]").after().to("mock:foo2");
                weaveByToString("To[mock:bar]").after().to("mock:bar2");
            }
View Full Code Here

*/
public class AdviceWithPolicyTest extends ContextTestSupport {

    public void testAdviceWithPolicy() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                weaveById("b").after().to("mock:result");
            }
        });
View Full Code Here

TOP

Related Classes of org.apache.camel.builder.AdviceWithRouteBuilder

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.