use of org.apache.cxf.ext.logging.LoggingOutInterceptor in project cxf by apache.
the class AegisClientServerTest method testReturnGenericPair.
@Test
public void testReturnGenericPair() throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setDataBinding(aegisBinding);
proxyFactory.setServiceClass(SportsService.class);
proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SportsService service = (SportsService) proxyFactory.create();
int ret = service.getGenericPair(new Pair<Integer, String>(111, "String"));
assertEquals(111, ret);
}
use of org.apache.cxf.ext.logging.LoggingOutInterceptor in project cxf by apache.
the class AegisClientServerTest method testGenericCollection.
@Test
public void testGenericCollection() throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setDataBinding(aegisBinding);
proxyFactory.setServiceClass(SportsService.class);
proxyFactory.setAddress("http://localhost:" + PORT + "/jaxwsAndAegisSports");
proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SportsService service = (SportsService) proxyFactory.create();
List<String> list = new ArrayList<>();
list.add("ffang");
String ret = service.getGeneric(list);
assertEquals(ret, "ffang");
}
use of org.apache.cxf.ext.logging.LoggingOutInterceptor in project cxf by apache.
the class AegisClientServerTest method testCollection.
@Test
public void testCollection() throws Exception {
AegisDatabinding aegisBinding = new AegisDatabinding();
JaxWsProxyFactoryBean proxyFactory = new JaxWsProxyFactoryBean();
proxyFactory.setDataBinding(aegisBinding);
proxyFactory.setServiceClass(SportsService.class);
proxyFactory.setWsdlLocation("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl");
proxyFactory.getInInterceptors().add(new LoggingInInterceptor());
proxyFactory.getOutInterceptors().add(new LoggingOutInterceptor());
SportsService service = (SportsService) proxyFactory.create();
Collection<Team> teams = service.getTeams();
assertEquals(1, teams.size());
assertEquals("Patriots", teams.iterator().next().getName());
// CXF-1251
String s = service.testForMinOccurs0("A", null, "b");
assertEquals("Anullb", s);
}
use of org.apache.cxf.ext.logging.LoggingOutInterceptor in project cxf by apache.
the class MultipleServiceShareClassTest method createGetterService.
private <T extends Getter> T createGetterService(final Class<T> serviceClass) {
JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
factory.setAddress("http://localhost:" + PORT + "/" + serviceClass.getSimpleName());
factory.getInInterceptors().add(new LoggingInInterceptor());
factory.getOutInterceptors().add(new LoggingOutInterceptor());
return factory.create(serviceClass);
}
use of org.apache.cxf.ext.logging.LoggingOutInterceptor in project cxf by apache.
the class SpringBeansTest method testInterceptors.
private void testInterceptors(ClassPathXmlApplicationContext ctx) {
EndpointImpl ep;
ep = (EndpointImpl) ctx.getBean("epWithInterceptors");
assertNotNull(ep);
List<Interceptor<? extends Message>> inInterceptors = ep.getInInterceptors();
boolean saaj = false;
boolean logging = false;
for (Interceptor<? extends Message> i : inInterceptors) {
if (i instanceof SAAJInInterceptor) {
saaj = true;
} else if (i instanceof LoggingInInterceptor) {
logging = true;
}
}
assertTrue(saaj);
assertTrue(logging);
saaj = false;
logging = false;
for (Interceptor<?> i : ep.getOutInterceptors()) {
if (i instanceof SAAJOutInterceptor) {
saaj = true;
} else if (i instanceof LoggingOutInterceptor) {
logging = true;
}
}
assertTrue(saaj);
}
Aggregations