Search in sources :

Example 1 with StructWithSubstitutionGroup

use of org.apache.type_test.types3.StructWithSubstitutionGroup in project cxf by apache.

the class AbstractTypeTestClient2 method testStructWithSubstitutionGroup.

@Test
public void testStructWithSubstitutionGroup() throws Exception {
    if (!shouldRunTest("StructWithSubstitutionGroup")) {
        return;
    }
    SgBaseTypeA baseA = new SgBaseTypeA();
    baseA.setVarInt(new BigInteger("1"));
    SgDerivedTypeB derivedB = new SgDerivedTypeB();
    derivedB.setVarInt(new BigInteger("32"));
    derivedB.setVarString("foo");
    ObjectFactory objectFactory = new ObjectFactory();
    StructWithSubstitutionGroup x = new StructWithSubstitutionGroup();
    JAXBElement<? extends SgBaseTypeA> elementA = objectFactory.createSg01BaseElementA(baseA);
    x.setSg01BaseElementA(elementA);
    StructWithSubstitutionGroup yOrig = new StructWithSubstitutionGroup();
    JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg01DerivedElementB(derivedB);
    yOrig.setSg01BaseElementA(elementB);
    Holder<StructWithSubstitutionGroup> y = new Holder<StructWithSubstitutionGroup>(yOrig);
    Holder<StructWithSubstitutionGroup> z = new Holder<StructWithSubstitutionGroup>();
    StructWithSubstitutionGroup ret;
    if (testDocLiteral) {
        ret = docClient.testStructWithSubstitutionGroup(x, y, z);
    } else if (testXMLBinding) {
        ret = xmlClient.testStructWithSubstitutionGroup(x, y, z);
    } else {
        ret = rpcClient.testStructWithSubstitutionGroup(x, y, z);
    }
    if (!perfTestOnly) {
        assertTrue("testStructWithSubstitutionGroup(): Incorrect value for inout param", equals(x, y.value));
        assertTrue("testStructWithSubstitutionGroup(): Incorrect value for out param", equals(yOrig, z.value));
        assertTrue("testStructWithSubstitutionGroup(): Incorrect return value", equals(x, ret));
    }
}
Also used : SgDerivedTypeB(org.apache.type_test.types3.SgDerivedTypeB) StructWithSubstitutionGroup(org.apache.type_test.types3.StructWithSubstitutionGroup) ObjectFactory(org.apache.type_test.types3.ObjectFactory) SgBaseTypeA(org.apache.type_test.types3.SgBaseTypeA) Holder(javax.xml.ws.Holder) BigInteger(java.math.BigInteger) Test(org.junit.Test)

Example 2 with StructWithSubstitutionGroup

use of org.apache.type_test.types3.StructWithSubstitutionGroup in project cxf by apache.

the class AbstractTypeTestClient2 method equals.

// org.apache.type_test.types3.StructWithSubstitutionGroup
protected boolean equals(StructWithSubstitutionGroup x, StructWithSubstitutionGroup y) {
    if (!x.getSg01BaseElementA().isNil() && !y.getSg01BaseElementA().isNil()) {
        SgBaseTypeA xTypeA = x.getSg01BaseElementA().getValue();
        SgBaseTypeA yTypeA = y.getSg01BaseElementA().getValue();
        return equals(xTypeA, yTypeA);
    }
    return false;
}
Also used : SgBaseTypeA(org.apache.type_test.types3.SgBaseTypeA)

Aggregations

SgBaseTypeA (org.apache.type_test.types3.SgBaseTypeA)2 BigInteger (java.math.BigInteger)1 Holder (javax.xml.ws.Holder)1 ObjectFactory (org.apache.type_test.types3.ObjectFactory)1 SgDerivedTypeB (org.apache.type_test.types3.SgDerivedTypeB)1 StructWithSubstitutionGroup (org.apache.type_test.types3.StructWithSubstitutionGroup)1 Test (org.junit.Test)1