use of org.apache.cxf.binding.corba.wsdl.OperationType in project cxf by apache.
the class WSDLToCorbaBindingTest method testCORBABindingGeneration.
@Test
public void testCORBABindingGeneration() throws Exception {
String fileName = getClass().getResource("/wsdl/simpleList.wsdl").toString();
generator.setWsdlFile(fileName);
generator.addInterfaceName("BasePortType");
Definition model = generator.generateCORBABinding();
QName bName = new QName("http://schemas.apache.org/tests", "BaseCORBABinding", "tns");
Binding binding = model.getBinding(bName);
assertNotNull(binding);
assertEquals("BaseCORBABinding", binding.getQName().getLocalPart());
assertEquals("BasePortType", binding.getPortType().getQName().getLocalPart());
assertEquals(1, binding.getExtensibilityElements().size());
assertEquals(1, binding.getBindingOperations().size());
for (ExtensibilityElement extElement : getExtensibilityElements(binding)) {
if ("binding".equals(extElement.getElementType().getLocalPart())) {
BindingType bindingType = (BindingType) extElement;
assertEquals(bindingType.getRepositoryID(), "IDL:BasePortType:1.0");
}
}
Iterator<?> j = binding.getBindingOperations().iterator();
while (j.hasNext()) {
BindingOperation bindingOperation = (BindingOperation) j.next();
assertEquals(1, bindingOperation.getExtensibilityElements().size());
assertEquals(bindingOperation.getBindingInput().getName(), "echoString");
assertEquals(bindingOperation.getBindingOutput().getName(), "echoStringResponse");
for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
if ("operation".equals(extElement.getElementType().getLocalPart())) {
OperationType corbaOpType = (OperationType) extElement;
assertEquals(corbaOpType.getName(), "echoString");
assertEquals(3, corbaOpType.getParam().size());
assertEquals(corbaOpType.getReturn().getName(), "return");
assertEquals(corbaOpType.getReturn().getIdltype(), CorbaConstants.NT_CORBA_STRING);
assertEquals(corbaOpType.getParam().get(0).getName(), "x");
assertEquals(corbaOpType.getParam().get(0).getMode().value(), "in");
QName qname = new QName("http://schemas.apache.org/tests/corba/typemap/", "StringEnum1", "ns1");
assertEquals(corbaOpType.getParam().get(0).getIdltype(), qname);
}
}
}
}
Aggregations