Examples of AdviceWithRouteBuilder


Examples of org.apache.camel.builder.AdviceWithRouteBuilder

        assertMockEndpointsSatisfied();
    }

    public void testRemove() throws Exception {
        // START SNIPPET: e2
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                // weave the type in the route and remove it
                weaveByType(TransformDefinition.class).remove();
            }
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

        assertMockEndpointsSatisfied();
    }

    public void testBefore() throws Exception {
        // START SNIPPET: e3
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                // weave the type in the route and remove it
                // and insert the following route path before the adviced node
                weaveByType(ToDefinition.class).before().transform(constant("Bye World"));
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

        assertMockEndpointsSatisfied();
    }

    public void testAfter() throws Exception {
        // START SNIPPET: e4
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                // weave the type in the route and remove it
                // and insert the following route path after the adviced node
                weaveByType(ToDefinition.class).after().transform(constant("Bye World"));
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

    // START SNIPPET: e1
    public void testAdvisedMockEndpointsWithSkip() throws Exception {
        // advice the first route using the inlined AdviceWith route builder
        // which has extended capabilities than the regular route builder
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {
            @Override
            public void configure() throws Exception {
                // mock sending to direct:foo and skip send to it
                mockEndpointsAndSkip("direct:foo");
            }
View Full Code Here

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

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

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

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

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

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

        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

Examples of org.apache.camel.builder.AdviceWithRouteBuilder

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

        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.