use of org.apache.type_test.types3.StructWithMultipleSubstitutionGroups in project cxf by apache.
the class AbstractTypeTestClient2 method testStructWithMultipleSubstitutionGroups.
@Test
public void testStructWithMultipleSubstitutionGroups() throws Exception {
if (!shouldRunTest("StructWithMultipleSubstitutionGroups")) {
return;
}
SgBaseTypeA baseA = new SgBaseTypeA();
baseA.setVarInt(new BigInteger("1"));
SgDerivedTypeB derivedB = new SgDerivedTypeB();
derivedB.setVarInt(new BigInteger("32"));
derivedB.setVarString("y-SgDerivedTypeB");
SgDerivedTypeC derivedC = new SgDerivedTypeC();
derivedC.setVarInt(new BigInteger("1"));
derivedC.setVarFloat(3.14f);
ObjectFactory objectFactory = new ObjectFactory();
JAXBElement<? extends SgBaseTypeA> x1 = objectFactory.createSg01DerivedElementB(derivedB);
JAXBElement<? extends SgBaseTypeA> x2 = objectFactory.createSg02BaseElementA(baseA);
JAXBElement<? extends SgBaseTypeA> y1 = objectFactory.createSg01DerivedElementB(derivedB);
JAXBElement<? extends SgBaseTypeA> y2 = objectFactory.createSg02DerivedElementC(derivedC);
StructWithMultipleSubstitutionGroups x = new StructWithMultipleSubstitutionGroups();
x.setVarFloat(111.1f);
x.setVarInt(new BigInteger("100"));
x.setVarString("x-varString");
x.setSg01BaseElementA(x1);
x.setSg02BaseElementA(x2);
StructWithMultipleSubstitutionGroups yOrig = new StructWithMultipleSubstitutionGroups();
yOrig.setVarFloat(1.1f);
yOrig.setVarInt(new BigInteger("10"));
yOrig.setVarString("y-varString");
yOrig.setSg01BaseElementA(y1);
yOrig.setSg02BaseElementA(y2);
Holder<StructWithMultipleSubstitutionGroups> y = new Holder<StructWithMultipleSubstitutionGroups>(yOrig);
Holder<StructWithMultipleSubstitutionGroups> z = new Holder<StructWithMultipleSubstitutionGroups>();
StructWithMultipleSubstitutionGroups ret;
if (testDocLiteral) {
ret = docClient.testStructWithMultipleSubstitutionGroups(x, y, z);
} else if (testXMLBinding) {
ret = xmlClient.testStructWithMultipleSubstitutionGroups(x, y, z);
} else {
ret = rpcClient.testStructWithMultipleSubstitutionGroups(x, y, z);
}
if (!perfTestOnly) {
assertTrue("testStructWithMultipleSubstitutionGroups(): Incorrect value for inout param", equals(x, y.value));
assertTrue("testStructWithMultipleSubstitutionGroups(): Incorrect value for out param", equals(yOrig, z.value));
assertTrue("testStructWithMultipleSubstitutionGroups(): Incorrect return value", equals(x, ret));
}
}
Aggregations