use of org.apache.camel.impl.EventDrivenConsumerRoute in project camel by apache.
the class RouteBuilderTest method testSplitter.
public void testSplitter() throws Exception {
List<Route> routes = buildSplitter();
log.debug("Created routes: " + routes);
assertEquals("Number routes created", 1, routes.size());
for (Route route : routes) {
Endpoint key = route.getEndpoint();
assertEquals("From endpoint", "direct://a", key.getEndpointUri());
EventDrivenConsumerRoute consumer = assertIsInstanceOf(EventDrivenConsumerRoute.class, route);
Channel channel = unwrapChannel(consumer.getProcessor());
assertIsInstanceOf(Splitter.class, channel.getNextProcessor());
}
}
use of org.apache.camel.impl.EventDrivenConsumerRoute in project camel by apache.
the class ContextErrorHandlerTest method testOverloadingTheDefaultErrorHandler.
public void testOverloadingTheDefaultErrorHandler() throws Exception {
RouteBuilder builder = new RouteBuilder() {
public void configure() {
errorHandler(loggingErrorHandler("FOO.BAR"));
from("seda:a").to("seda:b");
}
};
List<Route> list = getRouteListWithCurrentContext(builder);
assertEquals("Number routes created" + list, 1, list.size());
for (Route route : list) {
Endpoint key = route.getEndpoint();
assertEquals("From endpoint", "seda://a", key.getEndpointUri());
EventDrivenConsumerRoute consumerRoute = assertIsInstanceOf(EventDrivenConsumerRoute.class, route);
Processor processor = consumerRoute.getProcessor();
Channel channel = unwrapChannel(processor);
assertIsInstanceOf(LoggingErrorHandler.class, channel.getErrorHandler());
SendProcessor sendProcessor = assertIsInstanceOf(SendProcessor.class, channel.getNextProcessor());
log.debug("Found sendProcessor: " + sendProcessor);
}
}
use of org.apache.camel.impl.EventDrivenConsumerRoute in project camel by apache.
the class ResequencerTest method testBatchResequencerTypeWithoutJmx.
public void testBatchResequencerTypeWithoutJmx() throws Exception {
List<Route> list = getRouteList(createRouteBuilder());
assertEquals("Number of routes created: " + list, 1, list.size());
Route route = list.get(0);
EventDrivenConsumerRoute consumerRoute = assertIsInstanceOf(EventDrivenConsumerRoute.class, route);
DefaultChannel channel = assertIsInstanceOf(DefaultChannel.class, unwrapChannel(consumerRoute.getProcessor()));
assertIsInstanceOf(DefaultErrorHandler.class, channel.getErrorHandler());
assertFalse("Should not have stream caching", channel.hasInterceptorStrategy(StreamCaching.class));
assertIsInstanceOf(Resequencer.class, channel.getNextProcessor());
}
Aggregations