use of org.apache.camel.FailedToStartRouteException in project camel by apache.
the class RouteStartupOrderClashTest method testRouteStartupOrderClash.
public void testRouteStartupOrderClash() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("seda:foo").startupOrder(2).to("mock:result");
from("direct:start").startupOrder(1).to("seda:foo");
// clash as we got two routes with order 2
from("seda:bar").startupOrder(2).to("mock:bar");
}
});
try {
context.start();
fail("Should have thrown an exception");
} catch (FailedToStartRouteException e) {
// expected
assertTrue(e.getMessage().contains("startupOrder 2"));
}
}
use of org.apache.camel.FailedToStartRouteException in project camel by apache.
the class DisruptorConcurrentConsumersNPEIssueTest method testStartThird.
@Test
public void testStartThird() throws Exception {
final MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
template.sendBody("disruptor:foo", "Hello World");
assertMockEndpointsSatisfied();
// this should be okay
context.startRoute("third");
try {
context.startRoute("first");
fail("Should have thrown exception");
} catch (FailedToStartRouteException e) {
assertEquals("Failed to start route first because of Multiple consumers for the same endpoint is not allowed:" + " disruptor://foo?concurrentConsumers=5", e.getMessage());
}
}
Aggregations