Package org.apache.type_test.types1

Examples of org.apache.type_test.types1.StructWithUnion


    public void testComplexRestriction() throws Exception {
        if (!shouldRunTest("ComplexRestriction")) {
            return;
        }
        // normal case, maxLength=10
        ComplexRestriction x = new ComplexRestriction();
        x.setValue("str_x");
        ComplexRestriction yOrig = new ComplexRestriction();
        yOrig.setValue("string_yyy");
        Holder<ComplexRestriction> y = new Holder<ComplexRestriction>(yOrig);
        Holder<ComplexRestriction> z = new Holder<ComplexRestriction>();

        ComplexRestriction ret;
        if (testDocLiteral) {
            ret = docClient.testComplexRestriction(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testComplexRestriction(x, y, z);           
        } else {
            ret = rpcClient.testComplexRestriction(x, y, z);
        }
        if (!perfTestOnly) {
            assertEquals("testComplexRestriction(): Incorrect value for inout param",
                         x.getValue(), y.value.getValue());
            assertEquals("testComplexRestriction(): Incorrect value for out param",
                         yOrig.getValue(), z.value.getValue());
            assertEquals("testComplexRestriction(): Incorrect return value",
                         x.getValue(), ret.getValue());
        }

        // abnormal case
        if (testDocLiteral || testXMLBinding) {
            try {
                x = new ComplexRestriction();
                x.setValue("string_x");
                yOrig = new ComplexRestriction();
                yOrig.setValue("string_yyyyyy");
                y = new Holder<ComplexRestriction>(yOrig);
                z = new Holder<ComplexRestriction>();

                ret = testDocLiteral ? docClient.testComplexRestriction(x, y, z)
View Full Code Here


    public void testComplexRestriction2() throws Exception {
        if (!shouldRunTest("ComplexRestriction2")) {
            return;
        }
        // normal case, length=10
        ComplexRestriction2 x = new ComplexRestriction2();
        x.setValue("string_xxx");
        ComplexRestriction2 yOrig = new ComplexRestriction2();
        yOrig.setValue("string_yyy");
        Holder<ComplexRestriction2> y = new Holder<ComplexRestriction2>(yOrig);
        Holder<ComplexRestriction2> z = new Holder<ComplexRestriction2>();

        ComplexRestriction2 ret;
        if (testDocLiteral) {
            ret = docClient.testComplexRestriction2(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testComplexRestriction2(x, y, z);
        } else {
            ret = rpcClient.testComplexRestriction2(x, y, z);
        }
        if (!perfTestOnly) {
            assertEquals("testComplexRestriction2(): Incorrect value for inout param",
                         x.getValue(), y.value.getValue());
            assertEquals("testComplexRestriction2(): Incorrect value for out param",
                         yOrig.getValue(), z.value.getValue());
            assertEquals("testComplexRestriction2(): Incorrect return value",
                         x.getValue(), ret.getValue());
        }

        // abnormal case
        if (testDocLiteral || testXMLBinding) {
            try {
                x = new ComplexRestriction2();
                x.setValue("str_x");
                yOrig = new ComplexRestriction2();
                yOrig.setValue("string_yyy");
                y = new Holder<ComplexRestriction2>(yOrig);
                z = new Holder<ComplexRestriction2>();

                ret = testDocLiteral ? docClient.testComplexRestriction2(x, y, z)
View Full Code Here

        if (!shouldRunTest("ComplexRestriction3")) {
            return;
        }
        // normal case, maxLength=10 for ComplexRestriction
        // && minLength=5 for ComplexRestriction3
        ComplexRestriction3 x = new ComplexRestriction3();
        x.setValue("str_x");
        ComplexRestriction3 yOrig = new ComplexRestriction3();
        yOrig.setValue("string_yyy");
        Holder<ComplexRestriction3> y = new Holder<ComplexRestriction3>(yOrig);
        Holder<ComplexRestriction3> z = new Holder<ComplexRestriction3>();

        ComplexRestriction3 ret;
        if (testDocLiteral) {
            ret = docClient.testComplexRestriction3(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testComplexRestriction3(x, y, z);
        } else {
            ret = rpcClient.testComplexRestriction3(x, y, z);
        }
        if (!perfTestOnly) {
            assertEquals("testComplexRestriction3(): Incorrect value for inout param",
                         x.getValue(), y.value.getValue());
            assertEquals("testComplexRestriction3(): Incorrect value for out param",
                         yOrig.getValue(), z.value.getValue());
            assertEquals("testComplexRestriction3(): Incorrect return value",
                         x.getValue(), ret.getValue());
        }

        // abnormal cases
        if (testDocLiteral || testXMLBinding) {
            try {
                x = new ComplexRestriction3();
                x.setValue("str");
                y = new Holder<ComplexRestriction3>(yOrig);
                z = new Holder<ComplexRestriction3>();
                ret = testDocLiteral ? docClient.testComplexRestriction3(x, y, z)
                        : xmlClient.testComplexRestriction3(x, y, z);
                fail("maxLength=10 && minLength=5 restriction is violated.");
            } catch (Exception ex) {
                //ex.printStackTrace();
            }
            try {
                x = new ComplexRestriction3();
                x.setValue("string_x");
                yOrig = new ComplexRestriction3();
                yOrig.setValue("string_yyyyyy");
                y = new Holder<ComplexRestriction3>(yOrig);
                z = new Holder<ComplexRestriction3>();
                ret = testDocLiteral ? docClient.testComplexRestriction3(x, y, z)
                        : xmlClient.testComplexRestriction3(x, y, z);
View Full Code Here

        if (!shouldRunTest("ComplexRestriction4")) {
            return;
        }
        // normal case, maxLength=10 for ComplexRestriction
        // && maxLength=5 for ComplexRestriction4
        ComplexRestriction4 x = new ComplexRestriction4();
        x.setValue("str_x");
        ComplexRestriction4 yOrig = new ComplexRestriction4();
        yOrig.setValue("y");
        Holder<ComplexRestriction4> y = new Holder<ComplexRestriction4>(yOrig);
        Holder<ComplexRestriction4> z = new Holder<ComplexRestriction4>();

        ComplexRestriction4 ret;
        if (testDocLiteral) {
            ret = docClient.testComplexRestriction4(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testComplexRestriction4(x, y, z);
        } else {
            ret = rpcClient.testComplexRestriction4(x, y, z);
        }
        if (!perfTestOnly) {
            assertEquals("testComplexRestriction4(): Incorrect value for inout param",
                         x.getValue(), y.value.getValue());
            assertEquals("testComplexRestriction4(): Incorrect value for out param",
                         yOrig.getValue(), z.value.getValue());
            assertEquals("testComplexRestriction4(): Incorrect return value",
                         x.getValue(), ret.getValue());
        }

        // abnormal case
        if (testDocLiteral || testXMLBinding) {
            try {
                x = new ComplexRestriction4();
                x.setValue("str_xxx");
                y = new Holder<ComplexRestriction4>(yOrig);
                z = new Holder<ComplexRestriction4>();
                ret = testDocLiteral ? docClient.testComplexRestriction4(x, y, z)
                        : xmlClient.testComplexRestriction4(x, y, z);
View Full Code Here

    public void testComplexRestriction5() throws Exception {
        if (!shouldRunTest("ComplexRestriction5")) {
            return;
        }
        // normal case, maxLength=50 && minLength=5 for ComplexRestriction5
        ComplexRestriction5 x = new ComplexRestriction5();
        x.setValue("http://www.iona.com");
        ComplexRestriction5 yOrig = new ComplexRestriction5();
        yOrig.setValue("http://www.iona.com/info/services/oss/");
        Holder<ComplexRestriction5> y = new Holder<ComplexRestriction5>(yOrig);
        Holder<ComplexRestriction5> z = new Holder<ComplexRestriction5>();

        ComplexRestriction5 ret;
        if (testDocLiteral) {
            ret = docClient.testComplexRestriction5(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testComplexRestriction5(x, y, z);
        } else {
            ret = rpcClient.testComplexRestriction5(x, y, z);
        }
        if (!perfTestOnly) {
            assertEquals("testComplexRestriction5(): Incorrect value for inout param",
                         x.getValue(), y.value.getValue());
            assertEquals("testComplexRestriction5(): Incorrect value for out param",
                         yOrig.getValue(), z.value.getValue());
            assertEquals("testComplexRestriction5(): Incorrect return value",
                         x.getValue(), ret.getValue());
        }

        // abnormal cases
        if (testDocLiteral || testXMLBinding) {
            try {
                x = new ComplexRestriction5();
                x.setValue("uri");
                y = new Holder<ComplexRestriction5>(yOrig);
                z = new Holder<ComplexRestriction5>();
                ret = docClient.testComplexRestriction5(x, y, z);
                fail("maxLength=50 && minLength=5 restriction is violated.");
            } catch (Exception ex) {
                //ex.printStackTrace();
            }

            try {
                x = new ComplexRestriction5();
                x.setValue("http://www.iona.com");
                yOrig = new ComplexRestriction5();
                yOrig.setValue("http://www.iona.com/info/services/oss/info_services_oss_train.html");
                y = new Holder<ComplexRestriction5>(yOrig);
                z = new Holder<ComplexRestriction5>();
                ret = testDocLiteral ? docClient.testComplexRestriction5(x, y, z)
                        : xmlClient.testComplexRestriction5(x, y, z);
View Full Code Here

        return x.getArray1().equals(y.getArray1())
            && x.getArray2().equals(y.getArray2());
    }
   
    public void testCompoundArray() throws Exception {
        CompoundArray x = new CompoundArray();
        x.getArray1().addAll(Arrays.asList("AAA", "BBB", "CCC"));
        x.getArray2().addAll(Arrays.asList("aaa", "bbb", "ccc"));

        CompoundArray yOrig = new CompoundArray();
        yOrig.getArray1().addAll(Arrays.asList("XXX", "YYY", "ZZZ"));
        yOrig.getArray2().addAll(Arrays.asList("xxx", "yyy", "zzz"));

        Holder<CompoundArray> y = new Holder<CompoundArray>(yOrig);
        Holder<CompoundArray> z = new Holder<CompoundArray>();
        CompoundArray ret = client.testCompoundArray(x, y, z);

        if (!perfTestOnly) {
            assertTrue("testCompoundArray(): Incorrect value for inout param",
                       equals(x, y.value));
            assertTrue("testCompoundArray(): Incorrect value for out param",
View Full Code Here

    @Test
    public void testCompoundArray() throws Exception {
        if (!shouldRunTest("CompoundArray")) {
            return;
        }
        CompoundArray x = new CompoundArray();
        x.getArray1().addAll(Arrays.asList("AAA", "BBB", "CCC"));
        x.getArray2().addAll(Arrays.asList("aaa", "bbb", "ccc"));

        CompoundArray yOrig = new CompoundArray();
        yOrig.getArray1().addAll(Arrays.asList("XXX", "YYY", "ZZZ"));
        yOrig.getArray2().addAll(Arrays.asList("xxx", "yyy", "zzz"));

        Holder<CompoundArray> y = new Holder<CompoundArray>(yOrig);
        Holder<CompoundArray> z = new Holder<CompoundArray>();
        CompoundArray ret;
        if (testDocLiteral) {
            ret = docClient.testCompoundArray(x, y, z);
        } else if (testXMLBinding) {
            ret = xmlClient.testCompoundArray(x, y, z);
        } else {
View Full Code Here

        BigDecimal[] yy = {new BigDecimal("14.55"), new BigDecimal("-10.34"), new BigDecimal("11.22")};

        Holder<DecimalEnum> z = new Holder<DecimalEnum>();

        for (int i = 0; i < 3; i++) {
            DecimalEnum x = DecimalEnum.fromValue(xx[i]);
            DecimalEnum yOrig = DecimalEnum.fromValue(yy[i]);
            Holder<DecimalEnum> y = new Holder<DecimalEnum>(yOrig);

            DecimalEnum ret;
            if (testDocLiteral) {
                ret = docClient.testDecimalEnum(x, y, z);
            } else if (testXMLBinding) {
                ret = xmlClient.testDecimalEnum(x, y, z);
            } else {
                ret = rpcClient.testDecimalEnum(x, y, z);
            }
            if (!perfTestOnly) {
                assertEquals("testDecimalEnum(): Incorrect value for inout param",
                             x.value(), y.value.value());
                assertEquals("testDecimalEnum(): Incorrect value for out param", yOrig.value(), z.value
                    .value());
                assertEquals("testDecimalEnum(): Incorrect return value", x.value(), ret.value());
            }
        }
    }
View Full Code Here

        BigDecimal[] yy = {new BigDecimal("14.55"), new BigDecimal("-10.34"), new BigDecimal("11.22")};

        Holder<DecimalEnum> z = new Holder<DecimalEnum>();

        for (int i = 0; i < 3; i++) {
            DecimalEnum x = DecimalEnum.fromValue(xx[i]);
            DecimalEnum yOrig = DecimalEnum.fromValue(yy[i]);
            Holder<DecimalEnum> y = new Holder<DecimalEnum>(yOrig);

            DecimalEnum ret;
            if (testDocLiteral) {
                ret = docClient.testDecimalEnum(x, y, z);
            } else if (testXMLBinding) {
                ret = xmlClient.testDecimalEnum(x, y, z);
            } else {
                ret = rpcClient.testDecimalEnum(x, y, z);
            }
            if (!perfTestOnly) {
                assertEquals("testDecimalEnum(): Incorrect value for inout param",
                             x.value(), y.value.value());
                assertEquals("testDecimalEnum(): Incorrect value for out param", yOrig.value(), z.value
                    .value());
                assertEquals("testDecimalEnum(): Incorrect return value", x.value(), ret.value());
            }
        }
    }
View Full Code Here

    @Test
    public void testInheritanceUnboundedArrayDerivedChoice() throws Exception {
        if (!shouldRunTest("InheritanceUnboundedArrayDerivedChoice")) {
            return;
        }
        DerivedChoiceBaseArray x = new DerivedChoiceBaseArray();
        //Base
        x.getItem().addAll(Arrays.asList("AAA", "BBB", "CCC"));
        //Derived
        x.setVarStringExt("DerivedChoice-x");
        x.setAttrStringExt("DerivedAttr-x");

        DerivedChoiceBaseArray yOrig = new DerivedChoiceBaseArray();
        //Base
        yOrig.getItem().addAll(Arrays.asList("XXX", "YYY", "ZZZ"));
        //Derived
        yOrig.setVarFloatExt(1.414f);
        yOrig.setAttrStringExt("DerivedAttr-y");

        Holder<UnboundedArray> y = new Holder<UnboundedArray>(yOrig);
        Holder<UnboundedArray> z = new Holder<UnboundedArray>();
        UnboundedArray ret;
        if (testDocLiteral) {
View Full Code Here

TOP

Related Classes of org.apache.type_test.types1.StructWithUnion

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.