use of org.wildfly.camel.test.common.types.Endpoint in project wildfly-camel by wildfly-extras.
the class CXFWSConsumerIntegrationTest method testCXFConsumer.
@Test
public void testCXFConsumer() throws Exception {
CamelContext camelctx = contextRegistry.getCamelContext("cxfws-undertow");
Assert.assertNotNull("Expected cxfws-undertow to not be null", camelctx);
Assert.assertEquals(ServiceStatus.Started, camelctx.getStatus());
QName qname = new QName("http://wildfly.camel.test.cxf", "EndpointService");
Service service = Service.create(new URL("http://localhost:8080/EndpointService/EndpointPort?wsdl"), qname);
Endpoint endpoint = service.getPort(Endpoint.class);
Assert.assertNotNull("Endpoint not null", endpoint);
Assert.assertEquals("Hello Kermit", endpoint.echo("Kermit"));
}
use of org.wildfly.camel.test.common.types.Endpoint in project wildfly-camel by wildfly-extras.
the class CXFWSProducerIntegrationTest method testSimpleWar.
@Test
public void testSimpleWar() throws Exception {
deployer.deploy(SIMPLE_WAR);
try {
QName serviceName = new QName("http://wildfly.camel.test.cxf", "EndpointService");
Service service = Service.create(getWsdl("/simple"), serviceName);
Endpoint port = service.getPort(Endpoint.class);
Assert.assertEquals("Hello Foo", port.echo("Foo"));
} finally {
deployer.undeploy(SIMPLE_WAR);
}
}
use of org.wildfly.camel.test.common.types.Endpoint in project wildfly-camel by wildfly-extras.
the class CXFWSInterceptorTest method testCXFInterceptor.
@Test
public void testCXFInterceptor() throws Exception {
CountDownLatch latch = new CountDownLatch(1);
CamelContext camelctx = new DefaultCamelContext();
CxfComponent component = new CxfComponent(camelctx);
CxfEndpoint cxfEndpoint = new CxfEndpoint("http://localhost:8080/EndpointService/EndpointPort", component);
cxfEndpoint.setServiceClass(Endpoint.class);
List<Interceptor<? extends Message>> inInterceptors = cxfEndpoint.getInInterceptors();
inInterceptors.add(new CountDownInterceptor(latch));
camelctx.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from(cxfEndpoint).setBody(constant("Hello ${body}"));
}
});
camelctx.start();
try {
QName qname = new QName("http://wildfly.camel.test.cxf", "EndpointService");
Service service = Service.create(new URL("http://localhost:8080/EndpointService/EndpointPort?wsdl"), qname);
Endpoint endpoint = service.getPort(Endpoint.class);
endpoint.echo("Kermit");
Assert.assertTrue("Gave up waiting for CXF interceptor handleMessage", latch.await(5, TimeUnit.SECONDS));
} finally {
camelctx.stop();
}
}
use of org.wildfly.camel.test.common.types.Endpoint in project wildfly-camel by wildfly-extras.
the class CXFEndpointTest method testEndpoint.
@Test
public void testEndpoint() throws Exception {
QName qname = new QName("http://wildfly.camel.test.cxf", "EndpointService");
Service service = Service.create(new URL("http://" + wildflyIp + ":8080/EndpointService/EndpointPort?wsdl"), qname);
Endpoint endpoint = service.getPort(Endpoint.class);
Assert.assertNotNull("Endpoint not null", endpoint);
Assert.assertEquals("Hello Kermit", endpoint.echo("Kermit"));
}
Aggregations