use of org.apache.cxf.aegis.inheritance.Employee in project cxf by apache.
the class OverrideTypeTest method testOverrideBean.
@Test
public void testOverrideBean() throws Exception {
AegisDatabinding aegisDatabinding = new AegisDatabinding();
Set<String> types = new HashSet<>();
types.add("org.apache.cxf.aegis.inheritance.Employee");
aegisDatabinding.setOverrideTypes(types);
DataReader<XMLStreamReader> dataReader = aegisDatabinding.createReader(XMLStreamReader.class);
InputStream employeeBytes = testUtilities.getResourceAsStream("/org/apache/cxf/aegis/override/employee.xml");
XMLInputFactory readerFactory = XMLInputFactory.newInstance();
XMLStreamReader reader = readerFactory.createXMLStreamReader(employeeBytes);
Object objectRead = dataReader.read(reader);
assertNotNull(objectRead);
assertTrue(objectRead instanceof Employee);
Employee e = (Employee) objectRead;
assertEquals("long", e.getDivision());
}
Aggregations