Search in sources :

Example 1 with ChoiceWithSubstitutionGroupAbstract

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

the class AbstractTypeTestClient2 method equals.

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

Example 2 with ChoiceWithSubstitutionGroupAbstract

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

the class AbstractTypeTestClient2 method testChoiceWithSubstitutionGroupAbstract.

@Test
public void testChoiceWithSubstitutionGroupAbstract() throws Exception {
    if (!shouldRunTest("ChoiceWithSubstitutionGroupAbstract")) {
        return;
    }
    SgDerivedTypeB derivedB = new SgDerivedTypeB();
    derivedB.setVarInt(new BigInteger("32"));
    derivedB.setVarString("foo");
    SgDerivedTypeC derivedC = new SgDerivedTypeC();
    derivedC.setVarInt(new BigInteger("32"));
    derivedC.setVarFloat(3.14f);
    ObjectFactory objectFactory = new ObjectFactory();
    JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg03DerivedElementB(derivedB);
    JAXBElement<? extends SgBaseTypeA> elementC = objectFactory.createSg03DerivedElementC(derivedC);
    ChoiceWithSubstitutionGroupAbstract x = new ChoiceWithSubstitutionGroupAbstract();
    x.setSg03AbstractBaseElementA(elementC);
    ChoiceWithSubstitutionGroupAbstract yOrig = new ChoiceWithSubstitutionGroupAbstract();
    yOrig.setSg03AbstractBaseElementA(elementB);
    Holder<ChoiceWithSubstitutionGroupAbstract> y = new Holder<ChoiceWithSubstitutionGroupAbstract>(yOrig);
    Holder<ChoiceWithSubstitutionGroupAbstract> z = new Holder<ChoiceWithSubstitutionGroupAbstract>();
    ChoiceWithSubstitutionGroupAbstract ret;
    if (testDocLiteral) {
        ret = docClient.testChoiceWithSubstitutionGroupAbstract(x, y, z);
    } else if (testXMLBinding) {
        ret = xmlClient.testChoiceWithSubstitutionGroupAbstract(x, y, z);
    } else {
        ret = rpcClient.testChoiceWithSubstitutionGroupAbstract(x, y, z);
    }
    if (!perfTestOnly) {
        assertTrue("testChoiceWithSubstitutionGroupAbstract(): Incorrect value for inout param", equals(x, y.value));
        assertTrue("testChoiceWithSubstitutionGroupAbstract(): Incorrect value for out param", equals(yOrig, z.value));
        assertTrue("testChoiceWithSubstitutionGroupAbstract(): Incorrect return value", equals(x, ret));
    }
}
Also used : SgDerivedTypeB(org.apache.type_test.types3.SgDerivedTypeB) ObjectFactory(org.apache.type_test.types3.ObjectFactory) Holder(javax.xml.ws.Holder) BigInteger(java.math.BigInteger) ChoiceWithSubstitutionGroupAbstract(org.apache.type_test.types3.ChoiceWithSubstitutionGroupAbstract) SgDerivedTypeC(org.apache.type_test.types3.SgDerivedTypeC) Test(org.junit.Test)

Aggregations

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