Examples of AdviceWithRouteBuilder


Examples of org.apache.camel.builder.AdviceWithRouteBuilder

*/
public class AdviceWithInvalidConfiguredTest extends ContextTestSupport {

    public void testNoErrorHandler() throws Exception {
        try {
            context.getRouteDefinition("route-a").adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    errorHandler(loggingErrorHandler());

                    interceptSendToEndpoint("direct:bar")
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

        }
    }

    public void testNoExtraRoutes() throws Exception {
        try {
            context.getRouteDefinition("route-a").adviceWith(context, new AdviceWithRouteBuilder() {
                @Override
                public void configure() throws Exception {
                    from("direct:foo").to("mock:foo");

                }
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

*
*/
public class AdviceWithContextScopedErrorHandlerIssueTest extends ContextTestSupport {

    public void testAdviceWith() throws Exception {
        context.getRouteDefinition("route-a").adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("direct:bar")
                    .skipSendToOriginalEndpoint()
                    .throwException(new IllegalArgumentException("Forced"));
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

    }

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

        }
    }

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

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

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

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

        return true;
    }

    @Test
    public void testSimpleMultipleAdvice() throws Exception {
        context.getRouteDefinition("RouteA").adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("mock:resultA").process(new Processor() {
                    @Override
                    public void process(Exchange exchange) throws Exception {
                    }
                });
            }
        });

        context.getRouteDefinition("RouteB").adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
            }
        });
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

        assertMockEndpointsSatisfied();
    }

    @Test
    public void testMultipleAdviceWithExceptionThrown() throws Exception {
        context.getRouteDefinition("RouteA").adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("mock:resultA").process(new Processor() {
                    @Override
                    public void process(Exchange exchange) throws Exception {
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.