Search in sources :

Example 11 with SgBaseTypeA

use of org.apache.type_test.types3.SgBaseTypeA 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

SgBaseTypeA (org.apache.type_test.types3.SgBaseTypeA)7 Holder (javax.xml.ws.Holder)6 ObjectFactory (org.apache.type_test.types3.ObjectFactory)6 Test (org.junit.Test)6 BigInteger (java.math.BigInteger)5 SgDerivedTypeB (org.apache.type_test.types3.SgDerivedTypeB)5 SgDerivedTypeC (org.apache.type_test.types3.SgDerivedTypeC)3 ChoiceWithSubstitutionGroup (org.apache.type_test.types3.ChoiceWithSubstitutionGroup)1 ChoiceWithSubstitutionGroupAbstract (org.apache.type_test.types3.ChoiceWithSubstitutionGroupAbstract)1 ChoiceWithSubstitutionGroupNil (org.apache.type_test.types3.ChoiceWithSubstitutionGroupNil)1 StructWithMultipleSubstitutionGroups (org.apache.type_test.types3.StructWithMultipleSubstitutionGroups)1 StructWithSubstitutionGroup (org.apache.type_test.types3.StructWithSubstitutionGroup)1 StructWithSubstitutionGroupNil (org.apache.type_test.types3.StructWithSubstitutionGroupNil)1