Examples of adviceWith()


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

*/
public class ErrorHandlerAdviceIssueTest extends ContextTestSupport {

    public void testErrorHandlerAdvice() throws Exception {
        RouteDefinition foo = context.getRouteDefinition("foo");
        foo.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                        .skipSendToOriginalEndpoint()
                        .throwException(new IllegalAccessException("Forced"));
View Full Code Here

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

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

        RouteDefinition error = context.getRouteDefinition("error");
        error.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("file:*")
                        .skipSendToOriginalEndpoint()
                        .to("mock:file");
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()

                        }
                    });
            }
        };
        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()

                        }
                    });
            }
        };
        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 InterceptSendToEndpointWithParametersTest extends ContextTestSupport {

    public void testInterceptSendToEndpoint() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("log*").to("mock:http").skipSendToOriginalEndpoint();
            }
        });
View Full Code Here

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

*/
public class ErrorHandlerAdviceIssueTest extends ContextTestSupport {

    public void testErrorHandlerAdvice() throws Exception {
        RouteDefinition foo = context.getRouteDefinition("foo");
        foo.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                        .skipSendToOriginalEndpoint()
                        .throwException(new IllegalAccessException("Forced"));
View Full Code Here

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

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

        RouteDefinition error = context.getRouteDefinition("error");
        error.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("file:*")
                        .skipSendToOriginalEndpoint()
                        .to("mock:file");
View Full Code Here

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

*/
public class PropertiesComponentAdviceWithInterceptSendToEndpointTest extends ContextTestSupport {

    public void testAdviceWithInterceptSendToEndpoint() throws Exception {
        RouteDefinition route = context.getRouteDefinition("foo");
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("{{cool.mock}}:res*").to("mock:foo");
            }
        });
View Full Code Here

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

        }
    }

    public void testFailover() throws Exception {
        RouteDefinition routeDefinition = context.getRouteDefinitions().get(0);
        routeDefinition.adviceWith(context, new AdviceWithRouteBuilder());

        getMockEndpoint("mock:a").expectedMessageCount(0);
        getMockEndpoint("mock:b").expectedBodiesReceived("Intercepted SQL!");

        template.sendBody("direct:a", "foo");
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.