use of org.apache.cxf.binding.corba.wsdl.AddressType in project cxf by apache.
the class WSDLToCorbaBindingTypeTest method testSetCorbaAddressFile.
@Test
public void testSetCorbaAddressFile() throws Exception {
try {
URI fileName = getClass().getResource("/wsdl/datetime.wsdl").toURI();
generator.setWsdlFile(new File(fileName).getAbsolutePath());
generator.addInterfaceName("BasePortType");
Definition model = generator.generateCORBABinding();
QName name = new QName("http://schemas.apache.org/idl/datetime.idl", "BaseCORBAService", "tns");
Service service = model.getService(name);
Port port = service.getPort("BaseCORBAPort");
AddressType addressType = (AddressType) port.getExtensibilityElements().get(0);
String address = addressType.getLocation();
assertEquals("file:./Base.ref", address);
URL idl = getClass().getResource("/wsdl/addressfile.txt");
String filename = new File(idl.toURI()).getAbsolutePath();
generator.setAddressFile(filename);
model = generator.generateCORBABinding();
service = model.getService(name);
port = service.getPort("BaseCORBAPort");
addressType = (AddressType) port.getExtensibilityElements().get(0);
address = addressType.getLocation();
assertEquals("corbaloc::localhost:60000/hw", address);
} finally {
new File("datetime-corba.wsdl").deleteOnExit();
}
}
Aggregations