use of org.apache.camel.ResolveEndpointFailedException in project camel by apache.
the class RouteWithMistypedComponentNameTest method testNoSuchEndpointType.
public void testNoSuchEndpointType() throws Exception {
CamelContext context = new DefaultCamelContext();
try {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:hello").to("mock:result");
// unknown component
endpoint("mistyped:hello", Endpoint.class);
}
});
fail("Should have thrown a ResolveEndpointFailedException");
} catch (ResolveEndpointFailedException e) {
// expected
}
}
use of org.apache.camel.ResolveEndpointFailedException in project camel by apache.
the class RouteWithMistypedComponentNameTest method testNoSuchEndpoint.
public void testNoSuchEndpoint() throws Exception {
CamelContext context = new DefaultCamelContext();
try {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:hello").to("mock:result");
// unknown component
endpoint("mistyped:hello");
}
});
fail("Should have thrown a ResolveEndpointFailedException");
} catch (ResolveEndpointFailedException e) {
// expected
}
}
use of org.apache.camel.ResolveEndpointFailedException in project camel by apache.
the class RecipientListIgnoreInvalidEndpointsTest method testRecipientListWithoutIgnoreInvalidEndpointsOption.
public void testRecipientListWithoutIgnoreInvalidEndpointsOption() throws Exception {
MockEndpoint result = getMockEndpoint("mock:result");
result.expectedMessageCount(0);
MockEndpoint endpointA = getMockEndpoint("mock:endpointA");
endpointA.expectedMessageCount(0);
try {
template.requestBody("direct:startB", "Hello World", String.class);
fail("Expect the exception here.");
} catch (Exception ex) {
assertTrue("Get a wrong cause of the exception", ex.getCause() instanceof ResolveEndpointFailedException);
}
assertMockEndpointsSatisfied();
}
use of org.apache.camel.ResolveEndpointFailedException in project camel by apache.
the class PropertiesComponentDefaultTest method testPropertiesComponentDefaultNoFileFound.
public void testPropertiesComponentDefaultNoFileFound() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").to("properties:bar.end?locations=org/apache/camel/component/properties/unknown.properties");
}
});
try {
context.start();
fail("Should throw exception");
} catch (FailedToCreateRouteException e) {
ResolveEndpointFailedException cause = assertIsInstanceOf(ResolveEndpointFailedException.class, e.getCause());
FileNotFoundException fnfe = assertIsInstanceOf(FileNotFoundException.class, cause.getCause());
assertEquals("Properties file org/apache/camel/component/properties/unknown.properties not found in classpath", fnfe.getMessage());
}
}
use of org.apache.camel.ResolveEndpointFailedException in project wildfly-camel by wildfly-extras.
the class CustomComponentsTest method testMQTTComponentDoesNotLoad.
@Test
public void testMQTTComponentDoesNotLoad() throws Exception {
CamelContext camelctx = new DefaultCamelContext();
try {
camelctx.getEndpoint("mqtt://dummy");
Assert.fail("Expected a ResolveEndpointFailedException");
} catch (ResolveEndpointFailedException e) {
// expected
}
}
Aggregations