public void testClientServer() {
BusFactory.setDefaultBus(null);
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/frontend/spring/rountrip.xml"});
HelloService greeter = (HelloService) ctx.getBean("client");
assertNotNull(greeter);
String result = greeter.sayHello();
assertEquals("We get the wrong sayHello result", result, "hello");
Client c = ClientProxy.getClient(greeter);
TestInterceptor out = new TestInterceptor();
TestInterceptor in = new TestInterceptor();
c.getRequestContext().put(Message.OUT_INTERCEPTORS, Arrays.asList(new Interceptor[] {out}));
result = greeter.sayHello();
assertTrue(out.wasCalled());
out.reset();
c.getRequestContext().put(Message.IN_INTERCEPTORS, Arrays.asList(new Interceptor[] {in}));
result = greeter.sayHello();
assertTrue(out.wasCalled());
assertTrue(in.wasCalled());
}