use of org.apache.cxf.jaxws.handler.types.FullyQualifiedClassType in project cxf by apache.
the class HandlerChainBuilderTest method createHandlerChainType.
private List<PortComponentHandlerType> createHandlerChainType() {
List<PortComponentHandlerType> handlers = new ArrayList<>();
PortComponentHandlerType h = new PortComponentHandlerType();
CString name = new CString();
name.setValue("lh1");
h.setHandlerName(name);
FullyQualifiedClassType type = new FullyQualifiedClassType();
type.setValue(TestLogicalHandler.class.getName());
h.setHandlerClass(type);
handlers.add(h);
h = new PortComponentHandlerType();
name = new CString();
name.setValue("ph1");
h.setHandlerName(name);
type = new FullyQualifiedClassType();
type.setValue(TestProtocolHandler.class.getName());
h.setHandlerClass(type);
handlers.add(h);
h = new PortComponentHandlerType();
name = new CString();
name.setValue("ph2");
h.setHandlerName(name);
type = new FullyQualifiedClassType();
type.setValue(TestProtocolHandler.class.getName());
h.setHandlerClass(type);
handlers.add(h);
h = new PortComponentHandlerType();
name = new CString();
name.setValue("lh2");
h.setHandlerName(name);
type = new FullyQualifiedClassType();
type.setValue(TestLogicalHandler.class.getName());
h.setHandlerClass(type);
handlers.add(h);
return handlers;
}
use of org.apache.cxf.jaxws.handler.types.FullyQualifiedClassType in project cxf by apache.
the class HandlerChainBuilderTest method testBuilderCannotLoadHandlerClass.
@Test
public void testBuilderCannotLoadHandlerClass() {
List<PortComponentHandlerType> hc = createHandlerChainType();
hc.remove(3);
hc.remove(2);
hc.remove(1);
FullyQualifiedClassType type = new FullyQualifiedClassType();
type.setValue("no.such.class");
hc.get(0).setHandlerClass(type);
try {
builder.buildHandlerChainFromConfiguration(hc);
fail("did not get expected exception");
} catch (WebServiceException ex) {
// ex.printStackTrace();
assertNotNull(ex.getCause());
assertEquals(ClassNotFoundException.class, ex.getCause().getClass());
}
}
Aggregations