Search in sources :

Example 1 with SplitDefinition

use of org.apache.camel.model.SplitDefinition in project camel by apache.

the class SplitterWithCustomThreadPoolExecutorTest method getSplitter.

protected SplitDefinition getSplitter() {
    SplitDefinition result = null;
    List<RouteDefinition> routeDefinitions = context.getRouteDefinitions();
    for (RouteDefinition routeType : routeDefinitions) {
        result = firstSplitterType(routeType.getOutputs());
        if (result != null) {
            break;
        }
    }
    return result;
}
Also used : RouteDefinition(org.apache.camel.model.RouteDefinition) SplitDefinition(org.apache.camel.model.SplitDefinition)

Example 2 with SplitDefinition

use of org.apache.camel.model.SplitDefinition in project camel by apache.

the class AdviceWithTypeTest method testUnknownType.

public void testUnknownType() throws Exception {
    try {
        context.getRouteDefinitions().get(0).adviceWith(context, new AdviceWithRouteBuilder() {

            @Override
            public void configure() throws Exception {
                weaveByType(SplitDefinition.class).replace().to("mock:xxx");
            }
        });
        fail("Should hve thrown exception");
    } catch (IllegalArgumentException e) {
        assertTrue(e.getMessage(), e.getMessage().startsWith("There are no outputs which matches: SplitDefinition in the route"));
    }
}
Also used : SplitDefinition(org.apache.camel.model.SplitDefinition) AdviceWithRouteBuilder(org.apache.camel.builder.AdviceWithRouteBuilder)

Aggregations

SplitDefinition (org.apache.camel.model.SplitDefinition)2 AdviceWithRouteBuilder (org.apache.camel.builder.AdviceWithRouteBuilder)1 RouteDefinition (org.apache.camel.model.RouteDefinition)1