Package test.axis2.apache.org

Examples of test.axis2.apache.org.TestComplexElement


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;
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");

        try {
            OMElement omElement = testComplexElement.getOMElement(TestComplexElement.MY_QNAME, OMAbstractFactory.getSOAP11Factory());
            String omElementString;
            XMLStreamReader xmlReader;
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);
View Full Code Here

import java.io.ByteArrayInputStream;

public class SimpleExtensionTest extends TestCase {

    public void testSimpleTypeComplexExtension() {
        FullName fullName = new FullName();
        fullName.setFirst("amila");
        fullName.setMiddle("chinthaka");
        fullName.setLast("suriarachchi");
        fullName.setLanguage(new Language("singhala"));
        fullName.setAttribute1(BaseType.Factory.fromString(BaseType._s1, ""));

        fullName.setAttribute2(SimpleType.Factory.fromString("ATTRIBUTE", ""));

        try {
            OMElement omElement = fullName.getOMElement(FullName.MY_QNAME, OMAbstractFactory.getSOAP11Factory());
            String omElementString;
            XMLStreamReader xmlReader;
            FullName newFullName;

            omElementString = omElement.toStringWithConsume();
            System.out.println("OM String ==> " + omElementString);
            xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            newFullName = FullName.Factory.parse(xmlReader);
            assertEquals(newFullName.getFirst(), "amila");
            assertEquals(newFullName.getMiddle(), "chinthaka");
            assertEquals(newFullName.getLast(), "suriarachchi");
            assertEquals(newFullName.getLanguage().toString(), "singhala");
            assertEquals(newFullName.getAttribute1().toString(), BaseType._s1);
            assertEquals(newFullName.getAttribute2().toString(), "ATTRIBUTE");

            omElementString = omElement.toString();
            System.out.println("OM String ==> " + omElementString);
            xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            newFullName = FullName.Factory.parse(xmlReader);
            assertEquals(newFullName.getFirst(), "amila");
            assertEquals(newFullName.getMiddle(), "chinthaka");
            assertEquals(newFullName.getLast(), "suriarachchi");
            assertEquals(newFullName.getLanguage().toString(), "singhala");
            assertEquals(newFullName.getAttribute1().toString(), BaseType._s1);
            assertEquals(newFullName.getAttribute2().toString(), "ATTRIBUTE");
        } catch (Exception e) {
            assertFalse(true);
        }
    }
View Full Code Here

import java.io.ByteArrayInputStream;

public class SimpleExtensionTest extends TestCase {

    public void testSimpleTypeComplexExtension() {
        FullName fullName = new FullName();
        fullName.setFirst("amila");
        fullName.setMiddle("chinthaka");
        fullName.setLast("suriarachchi");
        fullName.setLanguage(new Language("singhala"));
        fullName.setAttribute1(BaseType.Factory.fromString(BaseType._s1, ""));

        fullName.setAttribute2(SimpleType.Factory.fromString("ATTRIBUTE", ""));

        try {
            OMElement omElement = fullName.getOMElement(FullName.MY_QNAME, OMAbstractFactory.getSOAP11Factory());
            String omElementString;
            XMLStreamReader xmlReader;
            FullName newFullName;

            omElementString = omElement.toStringWithConsume();
            System.out.println("OM String ==> " + omElementString);
            xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            newFullName = FullName.Factory.parse(xmlReader);
            assertEquals(newFullName.getFirst(), "amila");
            assertEquals(newFullName.getMiddle(), "chinthaka");
            assertEquals(newFullName.getLast(), "suriarachchi");
            assertEquals(newFullName.getLanguage().toString(), "singhala");
            assertEquals(newFullName.getAttribute1().toString(), BaseType._s1);
            assertEquals(newFullName.getAttribute2().toString(), "ATTRIBUTE");

            omElementString = omElement.toString();
            System.out.println("OM String ==> " + omElementString);
            xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            newFullName = FullName.Factory.parse(xmlReader);
            assertEquals(newFullName.getFirst(), "amila");
            assertEquals(newFullName.getMiddle(), "chinthaka");
            assertEquals(newFullName.getLast(), "suriarachchi");
            assertEquals(newFullName.getLanguage().toString(), "singhala");
            assertEquals(newFullName.getAttribute1().toString(), BaseType._s1);
            assertEquals(newFullName.getAttribute2().toString(), "ATTRIBUTE");
        } catch (Exception e) {
            assertFalse(true);
        }
    }
View Full Code Here

import java.io.ByteArrayInputStream;

public class SimpleExtensionTest extends TestCase {

    public void testSimpleTypeComplexExtension() {
        FullName fullName = new FullName();
        fullName.setFirst("amila");
        fullName.setMiddle("chinthaka");
        fullName.setLast("suriarachchi");
        fullName.setLanguage(new Language("singhala"));
        fullName.setAttribute1(BaseType.Factory.fromString(BaseType._s1,""));

        fullName.setAttribute2(SimpleType.Factory.fromString("ATTRIBUTE",""));

        OMElement omElement = fullName.getOMElement(FullName.MY_QNAME, OMAbstractFactory.getSOAP11Factory());
        try {
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM String ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            FullName newFullName = FullName.Factory.parse(xmlReader);
            assertEquals(newFullName.getFirst(),"amila");
            assertEquals(newFullName.getMiddle(),"chinthaka");
            assertEquals(newFullName.getLast(),"suriarachchi");
            assertEquals(newFullName.getLanguage().toString(),"singhala");
            assertEquals(newFullName.getAttribute1().toString(),BaseType._s1);
            assertEquals(newFullName.getAttribute2().toString(),"ATTRIBUTE");
        } catch (Exception e) {
            assertFalse(true);
        }
    }
View Full Code Here


public class ChiceTest extends TestCase {

    public void testChoice(){
        TestChoise testChoise = new TestChoise();
        testChoise.setChoice1("test 2");
        testChoise.setChoice2(5);

        try {
            OMElement omElement = testChoise.getOMElement(TestChoise.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestChoise newTestChoice = TestChoise.Factory.parse(xmlReader);
            assertEquals(5,newTestChoice.getChoice2());
        } catch (Exception e) {
            assertFalse(true);
        }
    }
View Full Code Here


public class ChiceTest extends TestCase {

    public void testChoice(){
        TestChoise testChoise = new TestChoise();
        testChoise.setChoice1("test 2");
        testChoise.setChoice2(5);

        try {
            OMElement omElement = testChoise.getOMElement(TestChoise.MY_QNAME, OMAbstractFactory.getOMFactory());
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestChoise newTestChoice = TestChoise.Factory.parse(xmlReader);
            assertEquals(5,newTestChoice.getChoice2());
        } catch (Exception e) {
            assertFalse(true);
        }
    }
View Full Code Here


public class ChiceTest extends TestCase {

    public void testChoice(){
        TestChoise testChoise = new TestChoise();
        testChoise.setChoice1("test 2");
        testChoise.setChoice2(5);

        OMElement omElement = testChoise.getOMElement(TestChoise.MY_QNAME, OMAbstractFactory.getOMFactory());
        try {
            String omElementString = omElement.toStringWithConsume();
            System.out.println("OM Element ==> " + omElementString);
            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
            TestChoise newTestChoice = TestChoise.Factory.parse(xmlReader);
            assertEquals(5,newTestChoice.getChoice2());
        } 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");

        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

TOP

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

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.