Package org.apache.axiom.om.ds.jaxb.beans

Examples of org.apache.axiom.om.ds.jaxb.beans.MyBean


     * {@link XMLStreamWriter}.
     */
    @Test
    public void testSerializeDirect() throws Exception {
        JAXBContext context = JAXBContext.newInstance(MyBean.class);
        MyBean orgBean = new MyBean(3, 5);
        JAXBOMDataSource ds = new JAXBOMDataSource(context, orgBean);
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(out);
        ds.serialize(writer);
        writer.close();
        MyBean bean = (MyBean)context.createUnmarshaller().unmarshal(
                new ByteArrayInputStream(out.toByteArray()));
        assertEquals(orgBean.getA(), bean.getA());
        assertEquals(orgBean.getB(), bean.getB());
    }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.ds.jaxb.beans.MyBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.