use of org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean in project cxf by apache.
the class JaxWsServiceFactoryBeanTest method testHolder.
@Test
public void testHolder() throws Exception {
ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
Bus bus = getBus();
bean.setBus(bus);
bean.setServiceClass(TestMtomImpl.class);
Service service = bean.create();
InterfaceInfo intf = service.getServiceInfos().get(0).getInterface();
OperationInfo op = intf.getOperation(new QName("http://cxf.apache.org/mime", "testXop"));
assertNotNull(op);
Iterator<MessagePartInfo> itr = op.getInput().getMessageParts().iterator();
assertTrue(itr.hasNext());
MessagePartInfo part = itr.next();
assertEquals("testXop", part.getElementQName().getLocalPart());
op = op.getUnwrappedOperation();
assertNotNull(op);
// test setup of input parts
itr = op.getInput().getMessageParts().iterator();
assertTrue(itr.hasNext());
part = itr.next();
assertEquals("name", part.getName().getLocalPart());
assertEquals(String.class, part.getTypeClass());
/*
* revisit, try to use other wsdl operation rewrite test in future
assertTrue(itr.hasNext());
part = itr.next();
assertEquals(Boolean.TRUE, part.getProperty(JaxWsServiceFactoryBean.MODE_INOUT));
assertEquals(byte[].class, part.getTypeClass());
assertFalse(itr.hasNext());
// test output setup
itr = op.getOutput().getMessageParts().iterator();
assertTrue(itr.hasNext());
part = itr.next();
assertEquals(Boolean.TRUE, part.getProperty(JaxWsServiceFactoryBean.MODE_INOUT));
*/
}
Aggregations