use of org.apache.cxf.greeter_control.Greeter in project camel by apache.
the class JaxWsWebFaultAnnotationToFaultTest method testInvokingServiceFromCXFClient.
@Test
public void testInvokingServiceFromCXFClient() throws Exception {
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
ClientFactoryBean clientBean = proxyFactory.getClientFactoryBean();
clientBean.setAddress(ROUTER_ADDRESS);
clientBean.setServiceClass(Greeter.class);
Greeter client = (Greeter) proxyFactory.create();
try {
client.pingMe();
fail("Expect to get an exception here");
} catch (PingMeFault expected) {
assertEquals(MESSAGE, expected.getMessage());
} catch (Throwable t) {
t.printStackTrace();
fail("The CXF client did not manage to map the client exception " + t.getClass().getName() + " to a " + PingMeFault.class.getName() + ": " + t.getMessage());
}
}
Aggregations