Package test.axis2.apache.org

Examples of test.axis2.apache.org.TestInnerSequence1


public class ComplexExtenstionTest extends TestCase {

    public void testComplexExtension() {

        TestComplexElement testComplexElement = new TestComplexElement();
        ExtendedComplexType extendedComplexType = new ExtendedComplexType();
        testComplexElement.setTestComplexElement(extendedComplexType);
        extendedComplexType.setFirst("Amila");
        extendedComplexType.setMiddle("Chinthaka");
        extendedComplexType.setLast("Suriarachchi");
        extendedComplexType.setParentElement1("test1");
        extendedComplexType.setParentElement2("test2");

        try {
            OMElement omElement = testComplexElement.getOMElement(TestComplexElement.MY_QNAME, OMAbstractFactory.getSOAP11Factory());
            String omElementString;
            XMLStreamReader xmlReader;
            TestComplexElement result;

            omElementString = omElement.toStringWithConsume();
            System.out.println("OM String ==> " + omElementString);
            xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            result = TestComplexElement.Factory.parse(xmlReader);
            assertEquals(result.getTestComplexElement().getFirst(),"Amila");
            assertEquals(result.getTestComplexElement().getMiddle(),"Chinthaka");
            assertEquals(result.getTestComplexElement().getLast(),"Suriarachchi");
            assertEquals(result.getTestComplexElement().getParentElement1(),"test1");
            assertEquals(result.getTestComplexElement().getParentElement2(),"test2");

            omElementString = omElement.toString();
            System.out.println("OM String ==> " + omElementString);
            xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            result = TestComplexElement.Factory.parse(xmlReader);
            assertEquals(result.getTestComplexElement().getFirst(),"Amila");
            assertEquals(result.getTestComplexElement().getMiddle(),"Chinthaka");
            assertEquals(result.getTestComplexElement().getLast(),"Suriarachchi");
            assertEquals(result.getTestComplexElement().getParentElement1(),"test1");
            assertEquals(result.getTestComplexElement().getParentElement2(),"test2");

        } catch (Exception e) {
            assertFalse(true);
        }
View Full Code Here


public class ComplexExtenstionTest extends TestCase {

    public void testComplexExtension() {

        TestComplexElement testComplexElement = new TestComplexElement();
        ExtendedComplexType extendedComplexType = new ExtendedComplexType();
        testComplexElement.setTestComplexElement(extendedComplexType);
        extendedComplexType.setFirst("Amila");
        extendedComplexType.setMiddle("Chinthaka");
        extendedComplexType.setLast("Suriarachchi");
        extendedComplexType.setParentElement1("test1");
        extendedComplexType.setParentElement2("test2");

        OMElement omElement = testComplexElement.getOMElement(TestComplexElement.MY_QNAME, OMAbstractFactory.getSOAP11Factory());
        try {
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM String ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestComplexElement result = TestComplexElement.Factory.parse(xmlReader);
            assertEquals(result.getTestComplexElement().getFirst(),"Amila");
            assertEquals(result.getTestComplexElement().getMiddle(),"Chinthaka");
            assertEquals(result.getTestComplexElement().getLast(),"Suriarachchi");
            assertEquals(result.getTestComplexElement().getParentElement1(),"test1");
            assertEquals(result.getTestComplexElement().getParentElement2(),"test2");
        } catch (Exception e) {
            assertFalse(true);
        }

    }
View Full Code Here

import java.io.ByteArrayInputStream;

public class InnerChoiceTest extends TestCase {

    public void testInnerChoice1() {
        TestInnerSequence1 testSequence = new TestInnerSequence1();
        testSequence.setSequence1("test sequence");
        testSequence.setSequence2(3);
        testSequence.setChoice1("test choice");
        testSequence.setChoice2(5);

        OMElement omElement = testSequence.getOMElement(TestInnerSequence1.MY_QNAME,
                OMAbstractFactory.getSOAP12Factory());
        try {
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OMelement ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestInnerSequence1 result = TestInnerSequence1.Factory.parse(xmlReader);
            assertEquals(result.getSequence1(), "test sequence");
            assertEquals(result.getSequence2(), 3);
            assertEquals(result.getChoice2(), 5);
        } catch (Exception e) {
            fail();
        }
    }
View Full Code Here

            fail();
        }
    }

    public void testInnerChoice21() {
        TestInnerSequence2 testSequence = new TestInnerSequence2();
        testSequence.setSequence1("sequence");
        testSequence.setSequence2(3);
        testSequence.setChoice1(new String[]{"choice1", "choice2"});

        OMElement omElement = testSequence.getOMElement(TestInnerSequence2.MY_QNAME,
                OMAbstractFactory.getSOAP12Factory());
        try {
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OMelement ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestInnerSequence2 result = TestInnerSequence2.Factory.parse(xmlReader);
            assertEquals(result.getSequence1(), "sequence");
            assertEquals(result.getSequence2(), 3);
            assertTrue(isEqual(result.getChoice1(), new String[]{"choice1", "choice2"}));
        } catch (Exception e) {
            fail();
        }
    }
View Full Code Here

            fail();
        }
    }

    public void testInnerChoice22() {
        TestInnerSequence2 testSequence = new TestInnerSequence2();
        testSequence.setSequence1("sequence");
        testSequence.setSequence2(3);
        testSequence.setChoice2(new int[]{2, 4});

        OMElement omElement = testSequence.getOMElement(TestInnerSequence2.MY_QNAME,
                OMAbstractFactory.getSOAP12Factory());
        try {
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OMelement ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestInnerSequence2 result = TestInnerSequence2.Factory.parse(xmlReader);
            assertEquals(result.getSequence1(), "sequence");
            assertEquals(result.getSequence2(), 3);
            assertTrue(isEqual(result.getChoice2(), new int[]{2, 4}));
        } catch (Exception e) {
            fail();
        }
    }
View Full Code Here

            fail();
        }
    }

    public void testInnerChoice32() {
            TestInnerSequence3 testSequence = new TestInnerSequence3();
            testSequence.setSequence1("sequence");
            testSequence.setSequence2(3);
            testSequence.setChoice2(new int[]{2,Integer.MIN_VALUE,6});

            OMElement omElement = testSequence.getOMElement(TestInnerSequence3.MY_QNAME,
                    OMAbstractFactory.getSOAP12Factory());
            try {
                String omElementString = omElement.toStringWithConsume();
                System.out.println("OMelement ==> " + omElementString);
                XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
                TestInnerSequence3 result = TestInnerSequence3.Factory.parse(xmlReader);
                assertEquals(result.getSequence1(), "sequence");
                assertEquals(result.getSequence2(), 3);
                assertTrue(isEqual(result.getChoice2(), new int[]{2,Integer.MIN_VALUE,6}));
            } catch (Exception e) {
                fail();
            }
        }
View Full Code Here

            fail();
        }
    }

    public void testInnerChoice31() {
        TestInnerSequence3 testSequence = new TestInnerSequence3();
        testSequence.setSequence1("sequence");
        testSequence.setSequence2(3);
        testSequence.setChoice1(new String[]{"choice1",null, "choice2"});

        OMElement omElement = testSequence.getOMElement(TestInnerSequence3.MY_QNAME,
                OMAbstractFactory.getSOAP12Factory());
        try {
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OMelement ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestInnerSequence3 result = TestInnerSequence3.Factory.parse(xmlReader);
            assertEquals(result.getSequence1(), "sequence");
            assertEquals(result.getSequence2(), 3);
            assertTrue(isEqual(result.getChoice1(), new String[]{"choice1",null, "choice2"}));
        } catch (Exception e) {
            fail();
        }
    }
View Full Code Here

TOP

Related Classes of test.axis2.apache.org.TestInnerSequence1

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.