use of org.apache.cxf.binding.corba.wsdl.OperationType in project cxf by apache.
the class WSDLToCorbaBindingTest method checkFixedTypeTwo.
private void checkFixedTypeTwo(BindingOperation bindingOperation, Map<String, CorbaType> mapType) {
for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
if ("operation".equals(extElement.getElementType().getLocalPart())) {
OperationType corbaOpType = (OperationType) extElement;
assertEquals(corbaOpType.getName(), "op_m");
assertEquals(3, corbaOpType.getParam().size());
assertEquals("X.PARAM.H", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
assertEquals("X.H", corbaOpType.getReturn().getIdltype().getLocalPart());
Fixed fixed = (Fixed) mapType.get(corbaOpType.getReturn().getIdltype().getLocalPart());
assertNotNull("Could not find the decimal type", fixed.getType());
assertEquals("Fixed digits is incorrect for the return corba parameter", 10, fixed.getDigits());
assertEquals("Fixed scale is incorrect for the return corba parameter", 2, fixed.getScale());
}
}
}
use of org.apache.cxf.binding.corba.wsdl.OperationType in project cxf by apache.
the class WSDLToCorbaBindingTest method getStringAttributeTest.
private void getStringAttributeTest(Binding binding) {
BindingOperation bindingOp = binding.getBindingOperation("_get_string_attribute", "_get_string_attribute", "_get_string_attributeResponse");
assertEquals("_get_string_attribute", bindingOp.getName());
assertEquals(1, bindingOp.getExtensibilityElements().size());
assertEquals(bindingOp.getBindingInput().getName(), "_get_string_attribute");
assertEquals(bindingOp.getBindingOutput().getName(), "_get_string_attributeResponse");
for (ExtensibilityElement extElement : getExtensibilityElements(bindingOp)) {
if ("operation".equals(extElement.getElementType().getLocalPart())) {
OperationType corbaOpType = (OperationType) extElement;
assertEquals(corbaOpType.getName(), "_get_string_attribute");
assertEquals(corbaOpType.getReturn().getName(), "return");
assertEquals(corbaOpType.getReturn().getIdltype(), CorbaConstants.NT_CORBA_STRING);
}
}
}
use of org.apache.cxf.binding.corba.wsdl.OperationType in project cxf by apache.
the class WSDLToCorbaBindingTest method getTestIdTest.
private void getTestIdTest(Binding binding) {
BindingOperation bindingOp = binding.getBindingOperation("_get_test_id", "_get_test_id", "_get_test_idResponse");
assertEquals("_get_test_id", bindingOp.getName());
assertEquals(1, bindingOp.getExtensibilityElements().size());
assertEquals(bindingOp.getBindingInput().getName(), "_get_test_id");
assertEquals(bindingOp.getBindingOutput().getName(), "_get_test_idResponse");
for (ExtensibilityElement extElement : getExtensibilityElements(bindingOp)) {
if ("operation".equals(extElement.getElementType().getLocalPart())) {
OperationType corbaOpType = (OperationType) extElement;
assertEquals(corbaOpType.getName(), "_get_test_id");
assertEquals(corbaOpType.getReturn().getName(), "return");
assertEquals(corbaOpType.getReturn().getIdltype(), CorbaConstants.NT_CORBA_FLOAT);
}
}
}
use of org.apache.cxf.binding.corba.wsdl.OperationType in project cxf by apache.
the class WSDLToCorbaBindingTest method testArrayMapping.
@Test
public void testArrayMapping() throws Exception {
try {
String fileName = getClass().getResource("/wsdl/array.wsdl").toString();
generator.setWsdlFile(fileName);
generator.addInterfaceName("X");
Definition model = generator.generateCORBABinding();
QName bName = new QName("http://schemas.apache.org/idl/anon.idl", "XCORBABinding", "tns");
Binding binding = model.getBinding(bName);
assertNotNull(binding);
assertEquals("XCORBABinding", binding.getQName().getLocalPart());
assertEquals("X", 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:X:1.0");
}
}
Iterator<?> j = binding.getBindingOperations().iterator();
while (j.hasNext()) {
BindingOperation bindingOperation = (BindingOperation) j.next();
assertEquals(1, bindingOperation.getExtensibilityElements().size());
assertEquals(bindingOperation.getBindingInput().getName(), "op_a");
assertEquals(bindingOperation.getBindingOutput().getName(), "op_aResponse");
for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
if ("operation".equals(extElement.getElementType().getLocalPart())) {
OperationType corbaOpType = (OperationType) extElement;
assertEquals(corbaOpType.getName(), "op_a");
assertEquals(1, corbaOpType.getParam().size());
assertNotNull(corbaOpType.getReturn());
ParamType paramtype = corbaOpType.getParam().get(0);
assertEquals(paramtype.getName(), "part1");
QName idltype = new QName("http://schemas.apache.org/idl/anon.idl/corba/typemap/", "ArrayType", "ns1");
assertEquals(paramtype.getIdltype(), idltype);
assertEquals(paramtype.getMode().toString(), "IN");
}
}
}
// See if an IDL is able to produce from this CORBA Binding.
WSDLToIDLAction idlgen = new WSDLToIDLAction();
idlgen.setBindingName("XCORBABinding");
idlgen.setOutputFile("array.idl");
idlgen.generateIDL(model);
File f = new File("array.idl");
assertTrue("array.idl should be generated", f.exists());
} finally {
new File("array.idl").deleteOnExit();
}
}
use of org.apache.cxf.binding.corba.wsdl.OperationType in project cxf by apache.
the class WSDLToCorbaBindingTest method checkFixedTypeThree.
private void checkFixedTypeThree(BindingOperation bindingOperation, Map<String, CorbaType> mapType) {
for (ExtensibilityElement extElement : getExtensibilityElements(bindingOperation)) {
if ("operation".equals(extElement.getElementType().getLocalPart())) {
OperationType corbaOpType = (OperationType) extElement;
assertEquals(corbaOpType.getName(), "op_n");
assertEquals(3, corbaOpType.getParam().size());
assertEquals("fixed_1", corbaOpType.getParam().get(0).getIdltype().getLocalPart());
assertEquals("Z.H", corbaOpType.getReturn().getIdltype().getLocalPart());
Fixed fixed = (Fixed) mapType.get(corbaOpType.getReturn().getIdltype().getLocalPart());
assertNotNull("Could not find the decimal type", fixed.getType());
assertEquals("Fixed digits is incorrect for the return corba parameter", 8, fixed.getDigits());
assertEquals("Fixed scale is incorrect for the return corba parameter", 6, fixed.getScale());
}
}
}
Aggregations