Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMElement.toStringWithConsume()


        unionQNameTestElement.setUnionQNameTestElement(unionQNameTest);
        unionQNameTest.setObject(new QName("http://www.google.com","test"));

        try {
            OMElement omElement = unionQNameTestElement.getOMElement(UnionQNameTestElement.MY_QNAME,OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            UnionQNameTestElement result = UnionQNameTestElement.Factory.parse(xmlReader);
            assertEquals(unionQNameTest.getObject(),result.getUnionQNameTestElement().getObject());
        } catch (Exception e) {
View Full Code Here


        TestElement1 testElement = new TestElement1();
        testElement.setAttribute1(1);
        OMElement omElement;
        try {
            omElement = testElement.getOMElement(TestElement1.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OMElement ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestElement1 result = TestElement1.Factory.parse(xmlReader);
            assertEquals(result.getAttribute1(),1);
        } catch (Exception e) {
View Full Code Here

        testListString.setString(new String[]{"string1","string2"});

       try {
           OMElement omElement = testListStringElement.getOMElement(TestListStringElement.MY_QNAME,
                       OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestListStringElement result = TestListStringElement.Factory.parse(xmlReader);
            assertEquals(testListString.toString(),result.getTestListStringElement().toString());
        } catch (Exception e) {
View Full Code Here

        testElement = new TestElement1();
        testElement.setAttribute1(Integer.MIN_VALUE);

        try {
            omElement = testElement.getOMElement(TestElement1.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OMElement ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestElement1 result = TestElement1.Factory.parse(xmlReader);
            assertEquals(result.getAttribute1(),Integer.MIN_VALUE);
        } catch (Exception e) {
View Full Code Here

        packingType_t_type0.setPackingType_T_type0("MINOR_a");
        packingType_t.setObject(packingType_t_type0);
        OMElement omElement;
        try {
            omElement = testInnerUnionType.getOMElement(TestInnerUnionType.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestInnerUnionType result = TestInnerUnionType.Factory.parse(xmlReader);
            assertEquals(packingType_t_type0.toString(),result.getTestInnerUnionType().getObject().toString());
        } catch (Exception e) {
View Full Code Here

        packingType_t_type1.setPackingType_T_type1("PROP_a");
        packingType_t.setObject(packingType_t_type1);

         try {
            omElement = testInnerUnionType.getOMElement(TestInnerUnionType.MY_QNAME,OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestInnerUnionType result = TestInnerUnionType.Factory.parse(xmlReader);
            assertEquals(packingType_t_type1.toString(),result.getTestInnerUnionType().getObject().toString());
        } catch (Exception e) {
View Full Code Here

        testInnerUnionType.setTestInnerUnionType(packingType_t);
        packingType_t.setObject(PackingType_T_type2.TAR);

        try {
            omElement = testInnerUnionType.getOMElement(TestInnerUnionType.MY_QNAME,OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestInnerUnionType result = TestInnerUnionType.Factory.parse(xmlReader);
            assertEquals(PackingType_T_type2.TAR,result.getTestInnerUnionType().getObject());
        } catch (Exception e) {
View Full Code Here

                        new QName("http://www.google","test3")});
        testListQNameElement.setTestListQNameElement(testListQName);

        try {
            OMElement omElement = testListQNameElement.getOMElement(TestListQNameElement.MY_QNAME,OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestListQNameElement result = TestListQNameElement.Factory.parse(xmlReader);
            assertEquals(result.getTestListQNameElement().getQName()[0],testListQName.getQName()[0]);
            assertEquals(result.getTestListQNameElement().getQName()[1],testListQName.getQName()[1]);
View Full Code Here

        TestElement2 testElement = new TestElement2();
        testElement.setAttribute1(1);
         OMElement omElement;
         try {
             omElement = testElement.getOMElement(TestElement2.MY_QNAME, OMAbstractFactory.getOMFactory());
             String omElementString = omElement.toStringWithConsume();
            System.out.println("OMElement ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestElement2 result = TestElement2.Factory.parse(xmlReader);
            assertEquals(result.getAttribute1(),1);
        } catch (Exception e) {
View Full Code Here

        testElement = new TestElement2();
        testElement.setAttribute1(Integer.MIN_VALUE);

        try {
            omElement = testElement.getOMElement(TestElement2.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OMElement ==> " + omElementString);
            fail();
        } catch (Exception e) {
            assertTrue(true);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.