use of org.apache.axiom.ts.om.document.xmlbeans.OrderDocument in project webservices-axiom by apache.
the class TestGetSAXResultXMLBeans method runTest.
@Override
protected void runTest() throws Throwable {
OrderDocument document = OrderDocument.Factory.newInstance();
Order order = document.addNewOrder();
order.setCustomerId("73107481");
Item item = order.addNewItem();
item.setPartId("P85-137-19");
item.setQuantity(2);
item = order.addNewItem();
item.setPartId("O85-554-66");
item.setQuantity(1);
StringWriter out = new StringWriter();
document.save(out);
OMDocument omDocument = metaFactory.getOMFactory().createOMDocument();
ContentHandler handler = omDocument.getSAXResult().getHandler();
document.save(handler, (LexicalHandler) handler);
assertAbout(xml()).that(xml(OMDocument.class, omDocument)).hasSameContentAs(out.toString());
}
Aggregations