use of javax.wsdl.Definition in project cxf by apache.
the class WSDLToCorbaBindingTypeTest method testComplexRestriction.
@Test
public void testComplexRestriction() throws Exception {
try {
URI fileName = getClass().getResource("/wsdl/complexRestriction.wsdl").toURI();
generator.setWsdlFile(new File(fileName).getAbsolutePath());
generator.addInterfaceName("TypeTestPortType");
Definition model = generator.generateCORBABinding();
Document document = writer.getDocument(model);
Element typemap = getElementNode(document, "corba:typeMapping");
assertNotNull(typemap);
assertEquals(1, typemap.getElementsByTagName("corba:struct").getLength());
} finally {
new File("complexRestriction-corba.wsdl").deleteOnExit();
}
}
use of javax.wsdl.Definition in project cxf by apache.
the class WSDLToCorbaBindingTypeTest method testAnonymousReturnParam.
@Test
public void testAnonymousReturnParam() throws Exception {
try {
String fileName = getClass().getResource("/wsdl/factory_pattern.wsdl").toString();
generator.setWsdlFile(fileName);
generator.addInterfaceName("Number");
Definition model = generator.generateCORBABinding();
Document document = writer.getDocument(model);
Element typemap = getElementNode(document, "corba:typeMapping");
assertNotNull(typemap);
assertEquals(3, typemap.getElementsByTagName("corba:struct").getLength());
} finally {
new File("factory_pattern-corba.wsdl").deleteOnExit();
}
}
use of javax.wsdl.Definition in project cxf by apache.
the class WSDLToCorbaBindingTypeTest method testNillableType.
@Test
public void testNillableType() throws Exception {
try {
String fileName = getClass().getResource("/wsdl/nillable.wsdl").toString();
generator.setWsdlFile(fileName);
generator.addInterfaceName("NillablePortType");
Definition model = generator.generateCORBABinding();
Document document = writer.getDocument(model);
Element typemap = getElementNode(document, "corba:typeMapping");
assertNotNull(typemap);
assertEquals(2, typemap.getElementsByTagName("corba:union").getLength());
assertEquals(1, typemap.getElementsByTagName("corba:struct").getLength());
TypeMappingType mapType = (TypeMappingType) model.getExtensibilityElements().get(0);
WSDLToIDLAction idlgen = new WSDLToIDLAction();
idlgen.setBindingName("NillableCORBABinding");
idlgen.setOutputFile("nillable.idl");
idlgen.generateIDL(model);
Union un = (Union) mapType.getStructOrExceptionOrUnion().get(2);
assertEquals("Name is incorrect for Union Type", "long_nil", un.getName());
assertEquals("Type is incorrect for Union Type", "PEl", un.getType().getLocalPart());
Unionbranch unbranch = un.getUnionbranch().get(0);
assertEquals("Name is incorrect for UnionBranch Type", "value", unbranch.getName());
assertEquals("Type is incorrect for UnionBranch Type", "long", unbranch.getIdltype().getLocalPart());
File f = new File("nillable.idl");
assertTrue("nillable.idl should be generated", f.exists());
} finally {
new File("nillable.idl").deleteOnExit();
}
}
use of javax.wsdl.Definition in project cxf by apache.
the class WSDLToCorbaBindingTypeTest method testListType.
@Test
public void testListType() throws Exception {
try {
URI fileName = getClass().getResource("/wsdl/listType.wsdl").toURI();
generator.setWsdlFile(new File(fileName).getAbsolutePath());
generator.addInterfaceName("TypeTestPortType");
Definition model = generator.generateCORBABinding();
Document document = writer.getDocument(model);
Element typemap = getElementNode(document, "corba:typeMapping");
assertNotNull(typemap);
assertEquals(1, typemap.getElementsByTagName("corba:enum").getLength());
assertEquals(1, typemap.getElementsByTagName("corba:sequence").getLength());
} finally {
new File("listType-corba.wsdl").deleteOnExit();
}
}
use of javax.wsdl.Definition in project cxf by apache.
the class WSDLToCorbaBindingTypeTest method testImportSchemaInTypes.
@Test
public void testImportSchemaInTypes() throws Exception {
try {
URI fileName = getClass().getResource("/wsdl/importType.wsdl").toURI();
generator.setWsdlFile(new File(fileName).getAbsolutePath());
generator.addInterfaceName("TypeTestPortType");
Definition model = generator.generateCORBABinding();
Document document = writer.getDocument(model);
Element typemap = getElementNode(document, "corba:typeMapping");
assertNotNull(typemap);
assertEquals(1, typemap.getElementsByTagName("corba:enum").getLength());
assertEquals(1, typemap.getElementsByTagName("corba:sequence").getLength());
} finally {
new File("importType-corba.wsdl").deleteOnExit();
}
}
Aggregations