OMFactory factory = OMAbstractFactory.getOMFactory();
JAXBContext context = JAXBContext.newInstance(DocumentBean.class);
DocumentBean orgBean = new DocumentBean();
orgBean.setId("AB23498");
orgBean.setContent(new DataHandler("test content", "text/plain"));
OMElement element = factory.createOMElement(new JAXBOMDataSource(context, orgBean));
DocumentBean bean = (DocumentBean)JAXBUtils.unmarshal(context, element, true);
assertEquals(orgBean.getId(), bean.getId());
assertEquals(orgBean.getContent(), bean.getContent());
}
}