use of org.apache.camel.FailedToCreateRouteException in project camel by apache.
the class TimerWithTimeOptionTest method testFiredInFutureIllegalTime.
public void testFiredInFutureIllegalTime() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
fromF("timer://foo?time=%s", "20090101").to("mock:result");
}
});
try {
context.start();
fail("Should throw an exception");
} catch (FailedToCreateRouteException e) {
assertIsInstanceOf(ParseException.class, e.getCause().getCause());
}
}
use of org.apache.camel.FailedToCreateRouteException in project camel by apache.
the class XsltFileNotFoundTest method testNoXsltFile.
public void testNoXsltFile() throws Exception {
try {
RouteBuilder builder = createRouteBuilder();
CamelContext context = new DefaultCamelContext();
context.addRoutes(builder);
context.start();
fail("Should have thrown an exception due XSLT file not found");
} catch (FailedToCreateRouteException e) {
assertIsInstanceOf(TransformerException.class, e.getCause());
assertIsInstanceOf(FileNotFoundException.class, e.getCause().getCause());
}
}
use of org.apache.camel.FailedToCreateRouteException in project camel by apache.
the class ProcessorTypeConfigurationTest method testProcessorRefMissConfigured.
public void testProcessorRefMissConfigured() throws Exception {
try {
context.addRoutes(new RouteBuilder() {
public void configure() throws Exception {
from("direct:in").process("hello");
}
});
fail("Should have thrown IllegalArgumentException");
} catch (FailedToCreateRouteException e) {
assertEquals("No bean could be found in the registry for: hello of type: org.apache.camel.Processor", e.getCause().getMessage());
}
}
use of org.apache.camel.FailedToCreateRouteException in project camel by apache.
the class StartingRoutesErrorReportedTest method testInvalidTo.
public void testInvalidTo() throws Exception {
try {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").routeId("route2").to("direct:result?foo=bar");
}
});
context.start();
fail();
} catch (FailedToCreateRouteException e) {
assertTrue(e.getMessage().startsWith("Failed to create route route2 at: >>> To[direct:result?foo=bar] <<< in route:" + " Route(route2)[[From[direct:start]] -> [To[direct:result?foo=... because of"));
}
}
use of org.apache.camel.FailedToCreateRouteException in project camel by apache.
the class StartingRoutesErrorReportedTest method testUnavailableDataFormatOnClasspath.
public void testUnavailableDataFormatOnClasspath() throws Exception {
try {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").routeId("route3").unmarshal().jaxb().log("Will never get here");
}
});
context.start();
fail("Should have thrown exception");
} catch (FailedToCreateRouteException e) {
assertTrue(e.getMessage().contains("Ensure that the data format is valid and the associated Camel component is present on the classpath"));
}
}
Aggregations