use of org.wildfly.extension.camel.WildFlyCamelContext in project wildfly-camel by wildfly-extras.
the class AS400IntegrationTest method testToString.
@Test
public void testToString() throws Exception {
String endpointUri = "jt400://user:password@host/qsys.lib/library.lib/queue.dtaq?ccsid=500&format=binary&connectionPool=#mockPool";
WildFlyCamelContext camelctx = new WildFlyCamelContext();
camelctx.getNamingContext().bind("mockPool", new AS400ConnectionPool());
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from(endpointUri).to("mock:end");
}
});
Jt400Endpoint endpoint = camelctx.getEndpoint(endpointUri, Jt400Endpoint.class);
Assert.assertEquals("host", endpoint.getSystemName());
}
use of org.wildfly.extension.camel.WildFlyCamelContext in project wildfly-camel by wildfly-extras.
the class JcrIntegrationTest method testJcrProducer.
@Test
public void testJcrProducer() throws Exception {
WildFlyCamelContext camelctx = new WildFlyCamelContext();
camelctx.getNamingContext().bind("repository", repository);
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
getContext().setUseBreadcrumb(false);
from("direct:a").to("jcr://user:pass@repository/home/test");
}
});
camelctx.start();
try {
String content = "<hello>world!</hello>";
HashMap<String, Object> headers = new HashMap<>();
headers.put(JcrConstants.JCR_NODE_NAME, "node");
headers.put("my.contents.property", content);
ProducerTemplate template = camelctx.createProducerTemplate();
String result = template.requestBodyAndHeaders("direct:a", null, headers, String.class);
Assert.assertNotNull(result);
Session session = openSession();
try {
Node node = session.getNodeByIdentifier(result);
Assert.assertEquals("/home/test/node", node.getPath());
Assert.assertEquals(content, node.getProperty("my.contents.property").getString());
} finally {
session.logout();
}
} finally {
camelctx.stop();
}
}
use of org.wildfly.extension.camel.WildFlyCamelContext in project wildfly-camel by wildfly-extras.
the class JNDIIntegrationTest method testArquillianResource.
@Test
public void testArquillianResource(@ArquillianResource CamelContextFactory contextFactory) throws Exception {
WildFlyCamelContext camelctx = contextFactory.createCamelContext();
assertBeanBinding(camelctx);
}
use of org.wildfly.extension.camel.WildFlyCamelContext in project wildfly-camel by wildfly-extras.
the class JNDIIntegrationTest method testCamelContextFactoryLookup.
@Test
public void testCamelContextFactoryLookup() throws Exception {
InitialContext inicxt = new InitialContext();
CamelContextFactory factory = (CamelContextFactory) inicxt.lookup(CamelConstants.CAMEL_CONTEXT_FACTORY_BINDING_NAME);
WildFlyCamelContext camelctx = factory.createCamelContext();
assertBeanBinding(camelctx);
}
use of org.wildfly.extension.camel.WildFlyCamelContext in project wildfly-camel by wildfly-extras.
the class JNDIIntegrationTest method testCamelContextFactoryService.
@Test
public void testCamelContextFactoryService() throws Exception {
CamelContextFactory contextFactory = ServiceLocator.getRequiredService(CamelContextFactory.class);
WildFlyCamelContext camelctx = contextFactory.createCamelContext(getClass().getClassLoader());
assertBeanBinding(camelctx);
}
Aggregations