Package org.apache.tuscany.sca.databinding.javabeans

Examples of org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLStreamReader


    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testTransformation() {
        JavaBean2XMLStreamReader t2 = new JavaBean2XMLStreamReader();
        MyBean bean = new MyBean();
        bean.str = "ABC";
        bean.i = 1;
        bean.arr = new long[] {1, 2, 3};
        bean.bean = new AnotherBean();
        bean.bean.setName("Name");
        XMLStreamReader reader = t2.transform(bean, null);
        XMLStreamReader2String t3 = new XMLStreamReader2String();
        String xml = t3.transform(reader, null);
        assertTrue(xml.contains("<JavaBean2XMLStreamReaderTestCase$MyBean>"
                     + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean>"
                     + "<i>1</i><str>ABC</str></JavaBean2XMLStreamReaderTestCase$MyBean>"));
View Full Code Here


    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testTransformation() {
        JavaBean2XMLStreamReader t2 = new JavaBean2XMLStreamReader();
        MyBean bean = new MyBean();
        bean.str = "ABC";
        bean.i = 1;
        bean.arr = new long[] {1, 2, 3};
        bean.bean = new AnotherBean();
        bean.bean.setName("Name");
        XMLStreamReader reader = t2.transform(bean, null);
        XMLStreamReader2String t3 = new XMLStreamReader2String();
        String xml = t3.transform(reader, null);
        assertTrue(xml.contains("<JavaBean2XMLStreamReaderTestCase$MyBean>"
                     + "<arr>1</arr><arr>2</arr><arr>3</arr><bean><name>Name</name></bean>"
                     + "<i>1</i><str>ABC</str></JavaBean2XMLStreamReaderTestCase$MyBean>"));
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
    }

    public void testTransformation() throws Exception {
        JavaBean2XMLStreamReader t2 = new JavaBean2XMLStreamReader();
        MyBean bean = new MyBean();
        bean.str = "ABC";
        bean.i = 1;
        bean.arr = new long[] {1, 2, 3};
        bean.bean = new AnotherBean();
        bean.bean.setName("Name");
        XMLStreamReader reader = t2.transform(bean, null);
        XMLStreamReader2String t3 = new XMLStreamReader2String();
        String xml = t3.transform(reader, null);
        XMLAssert.assertXMLEqual(XML_RESULT, xml);

    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.databinding.javabeans.JavaBean2XMLStreamReader

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.