Examples of adviceWith()


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

*/
public class RouteScopedOnExceptionWithInterceptSendToEndpointIssueTest extends ContextTestSupport {

    public void testIssue() throws Exception {
        RouteDefinition route = context.getRouteDefinitions().get(0);
        route.adviceWith(context, new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                interceptSendToEndpoint("seda:*")
                    .skipSendToOriginalEndpoint()
                    .throwException(new ConnectException("Forced"));
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 HttpInterceptSendToEndpointTest extends CamelTestSupport {

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

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

*/
public class AdviceWithTwoRoutesTest extends ContextTestSupport {

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

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

        assertMockEndpointsSatisfied();
    }

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

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()
                    .to("mock:detour");
View Full Code Here

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

                    .to("mock:detour");
            }
        });

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

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

*/
public class AdviceWithTwoRoutesOnExceptionTest extends ContextTestSupport {

    public void testAdviceWithA() 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()

        assertMockEndpointsSatisfied();
    }

    public void testAdviceWithB() throws Exception {
        RouteDefinition 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
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.