use of org.apache.camel.FailedToCreateProducerException in project camel by apache.
the class JmsTestConnectionOnStartupTest method testConnectionOnStartupProducerTest.
@Test
public void testConnectionOnStartupProducerTest() throws Exception {
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("direct:start").to("activemq:queue:foo?testConnectionOnStartup=true");
}
});
try {
context.start();
fail("Should have thrown an exception");
} catch (FailedToCreateProducerException e) {
assertTrue(e.getMessage().startsWith("Failed to create Producer for endpoint: activemq://queue:foo?testConnectionOnStartup=true."));
assertTrue(e.getMessage().contains("java.net.ConnectException"));
}
}
Aggregations