use of org.apache.cxf.jaxws.handler.types.CString in project cxf by apache.
the class HandlerChainBuilderTest method testBuilderCallsInitWithNoInitParamValues.
@Test
public void testBuilderCallsInitWithNoInitParamValues() {
List<PortComponentHandlerType> hc = createHandlerChainType();
hc.remove(3);
hc.remove(2);
hc.remove(1);
PortComponentHandlerType h = hc.get(0);
List<ParamValueType> params = h.getInitParam();
ParamValueType p = new ParamValueType();
CString pName = new CString();
pName.setValue("foo");
p.setParamName(pName);
params.add(p);
List<Handler> chain = builder.buildHandlerChainFromConfiguration(hc);
assertEquals(1, chain.size());
TestLogicalHandler tlh = (TestLogicalHandler) chain.get(0);
assertTrue(tlh.initCalled);
Map cfg = tlh.config;
assertNotNull(tlh.config);
assertEquals(1, cfg.keySet().size());
}
use of org.apache.cxf.jaxws.handler.types.CString 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.CString in project cxf by apache.
the class HandlerChainBuilderTest method testBuilderCallsInit.
@Test
public void testBuilderCallsInit() {
List<PortComponentHandlerType> hc = createHandlerChainType();
hc.remove(3);
hc.remove(2);
hc.remove(1);
PortComponentHandlerType h = hc.get(0);
List<ParamValueType> params = h.getInitParam();
ParamValueType p = new ParamValueType();
CString pName = new CString();
pName.setValue("foo");
p.setParamName(pName);
XsdStringType pValue = new XsdStringType();
pValue.setValue("1");
p.setParamValue(pValue);
params.add(p);
p = new ParamValueType();
pName = new CString();
pName.setValue("bar");
p.setParamName(pName);
pValue = new XsdStringType();
pValue.setValue("2");
p.setParamValue(pValue);
params.add(p);
List<Handler> chain = builder.buildHandlerChainFromConfiguration(hc);
assertEquals(1, chain.size());
TestLogicalHandler tlh = (TestLogicalHandler) chain.get(0);
assertTrue(tlh.initCalled);
Map cfg = tlh.config;
assertNotNull(tlh.config);
assertEquals(2, cfg.keySet().size());
assertEquals("1", cfg.get("foo"));
assertEquals("2", cfg.get("bar"));
}
Aggregations