use of org.apache.cxf.jaxrs.resources.SuperBook in project cxf by apache.
the class JAXBElementProviderTest method testWriteDerivedType.
@Test
public void testWriteDerivedType() throws Exception {
JAXBElementProvider<Book> provider = new JAXBElementProvider<Book>();
provider.setJaxbElementClassNames(Collections.singletonList(Book.class.getName()));
Book b = new SuperBook("CXF in Action", 123L, 124L);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
provider.writeTo(b, Book.class, Book.class, new Annotation[0], MediaType.TEXT_XML_TYPE, new MetadataMap<String, Object>(), bos);
readSuperBook(bos.toString(), true);
}
Aggregations