use of org.apache.cxf.tests.inherit.types.ObjectInfo in project cxf by apache.
the class ClientServerMiscTest method testInheritedTypesInOtherPackage.
@Test
public void testInheritedTypesInOtherPackage() throws Exception {
InheritService serv = new InheritService();
Inherit port = serv.getInheritPort();
updateAddressPort(port, PORT);
ObjectInfo obj = port.getObject(0);
assertNotNull(obj);
assertNotNull(obj.getBaseObject());
assertEquals("A", obj.getBaseObject().getName());
assertTrue(obj.getBaseObject() instanceof SubTypeA);
obj = port.getObject(1);
assertNotNull(obj);
assertNotNull(obj.getBaseObject());
assertEquals("B", obj.getBaseObject().getName());
assertTrue(obj.getBaseObject() instanceof SubTypeB);
}
use of org.apache.cxf.tests.inherit.types.ObjectInfo in project cxf by apache.
the class InheritImpl method getObject.
public ObjectInfo getObject(int type) {
ObjectInfo info = new ObjectInfo();
info.setType("Type: " + type);
BaseType ba = null;
switch(type) {
case 0:
ba = new SubTypeA();
ba.setName("A");
((SubTypeA) ba).setAvalue("A");
break;
case 1:
ba = new SubTypeB();
ba.setName("B");
((SubTypeB) ba).setBvalue("B");
break;
default:
}
info.setBaseObject(ba);
return info;
}
Aggregations