Examples of adviceWith()


Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        assertMockEndpointsSatisfied();
    }

    public void testAdviceWithAB() throws Exception {
        RouteDefinition route = context.getRouteDefinition("a");
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("mock://a")
                    .skipSendToOriginalEndpoint()
                    .throwException(new IllegalArgumentException("Forced"));
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

                    .throwException(new IllegalArgumentException("Forced"));
            }
        });

        route = context.getRouteDefinition("b");
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("mock://b")
                    .skipSendToOriginalEndpoint()
                    .throwException(new IllegalArgumentException("Forced"));
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

    }

    public void testAdviceWithErrorHandler() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        try {
            route.adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    errorHandler(deadLetterChannel("mock:dead"));
                }
            });
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        }
    }

    public void testAdviceWithOnException() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                onException(IllegalArgumentException.class)
                        .handled(true)
                        .to("mock:error");
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        assertMockEndpointsSatisfied();
    }

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

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        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

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

        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

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

                        }
                    });
            }
        };
        RouteDefinition routeDefinition = context.getRouteDefinition("JdbcMessageIdRepositoryTest");
        routeDefinition.adviceWith(context, interceptor);

        // we send in 2 messages with id 2 that fails
        errorEndpoint.expectedMessageCount(2);
        resultEndpoint.expectedBodiesReceived("one", "three");
View Full Code Here

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

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

Examples of org.apache.camel.model.RouteDefinition.adviceWith()

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