use of org.apache.camel.model.ProcessorDefinition in project camel by apache.
the class PropertiesRouteFromTest method testPropertiesRouteFrom.
public void testPropertiesRouteFrom() throws Exception {
ProcessorDefinition out = context.getRouteDefinition("foo").getOutputs().get(0);
assertEquals("{{cool.end}}", ((SendDefinition) out).getUri());
String uri = context.getRouteDefinition("foo").getInputs().get(0).getUri();
assertEquals("{{cool.start}}", uri);
// use a routes definition to dump the routes
String xml = ModelHelper.dumpModelAsXml(context, context.getRouteDefinition("foo"));
assertTrue(xml.contains("<from uri=\"{{cool.start}}\"/>"));
assertTrue(xml.contains("<to id=\"to1\" uri=\"{{cool.end}}\"/>"));
}
use of org.apache.camel.model.ProcessorDefinition in project ddf by codice.
the class ContentDirectoryMonitorTest method verifyRoute.
private void verifyRoute(RouteDefinition routeDefinition, String monitoredDirectory, String processingMechanism) {
List<FromDefinition> fromDefinitions = routeDefinition.getInputs();
assertThat(fromDefinitions.size(), is(1));
String uri = fromDefinitions.get(0).getUri();
String expectedUri = "file:" + monitoredDirectory + "?recursive=true&moveFailed=.errors&readLockMinLength=1&readLock=changed&readLockTimeout=2000&readLockCheckInterval=1000";
if (ContentDirectoryMonitor.DELETE.equals(processingMechanism)) {
expectedUri += "&delete=true";
} else if (ContentDirectoryMonitor.MOVE.equals(processingMechanism)) {
expectedUri += "&move=.ingested";
} else if (ContentDirectoryMonitor.IN_PLACE.equals(processingMechanism)) {
expectedUri = "durable:" + monitoredDirectory;
}
assertThat(uri, equalTo(expectedUri));
List<ProcessorDefinition<?>> processorDefinitions = routeDefinition.getOutputs();
if (ContentDirectoryMonitor.IN_PLACE.equals(processingMechanism)) {
assertThat(processorDefinitions.size(), is(2));
} else {
assertThat(processorDefinitions.size(), is(1));
}
}
Aggregations