use of org.apache.camel.FailedToStartRouteException in project camel by apache.
the class DisruptorConcurrentConsumersNPEIssueTest method testSendToDisruptor.
@Test
public void testSendToDisruptor() throws Exception {
final MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
template.sendBody("disruptor:foo", "Hello World");
assertMockEndpointsSatisfied();
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());
}
}
use of org.apache.camel.FailedToStartRouteException in project camel by apache.
the class SedaConcurrentConsumersNPEIssueTest method testSendToSeda.
public void testSendToSeda() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
template.sendBody("seda:foo", "Hello World");
assertMockEndpointsSatisfied();
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:" + " seda://foo?concurrentConsumers=5", e.getMessage());
}
}
use of org.apache.camel.FailedToStartRouteException in project camel by apache.
the class SedaConcurrentConsumersNPEIssueTest method testStartThird.
public void testStartThird() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedBodiesReceived("Hello World");
template.sendBody("seda: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:" + " seda://foo?concurrentConsumers=5", e.getMessage());
}
}
use of org.apache.camel.FailedToStartRouteException in project camel by apache.
the class DirectNoMultipleConsumersTest method testNoMultipleConsumersTest.
public void testNoMultipleConsumersTest() throws Exception {
CamelContext container = new DefaultCamelContext();
container.disableJMX();
container.addRoutes(new RouteBuilder() {
public void configure() throws Exception {
from("direct:in").to("mock:result");
from("direct:in").to("mock:result");
}
});
try {
container.start();
fail("Should have thrown an FailedToStartRouteException");
} catch (FailedToStartRouteException e) {
// expected
} finally {
container.stop();
}
}
use of org.apache.camel.FailedToStartRouteException in project camel by apache.
the class DirectEndpointRouteInlinedTest method testDirectExistingExists.
public void testDirectExistingExists() throws Exception {
try {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").to("mock:result");
from("direct:start").to("mock:bar");
}
});
fail("Should have thrown exception");
} catch (FailedToStartRouteException e) {
assertEquals("Failed to start route route2 because of Multiple consumers for the same endpoint is not allowed: direct://start", e.getMessage());
}
}
Aggregations