use of org.apache.type_test.types3.ChoiceWithSubstitutionGroup in project cxf by apache.
the class AbstractTypeTestClient2 method testChoiceWithSubstitutionGroup.
@Test
public void testChoiceWithSubstitutionGroup() throws Exception {
if (!shouldRunTest("ChoiceWithSubstitutionGroup")) {
return;
}
SgBaseTypeA baseA = new SgBaseTypeA();
baseA.setVarInt(new BigInteger("1"));
ObjectFactory objectFactory = new ObjectFactory();
JAXBElement<? extends SgBaseTypeA> elementA = objectFactory.createSg01BaseElementA(baseA);
SgDerivedTypeB derivedB = new SgDerivedTypeB();
derivedB.setVarInt(new BigInteger("32"));
derivedB.setVarString("SgDerivedTypeB");
JAXBElement<? extends SgBaseTypeA> elementB = objectFactory.createSg01DerivedElementB(derivedB);
ChoiceWithSubstitutionGroup x = new ChoiceWithSubstitutionGroup();
x.setSg01BaseElementA(elementA);
ChoiceWithSubstitutionGroup yOrig = new ChoiceWithSubstitutionGroup();
yOrig.setSg01BaseElementA(elementB);
Holder<ChoiceWithSubstitutionGroup> y = new Holder<ChoiceWithSubstitutionGroup>(yOrig);
Holder<ChoiceWithSubstitutionGroup> z = new Holder<ChoiceWithSubstitutionGroup>();
assertTrue("yoo: ", equals(y.value, y.value));
ChoiceWithSubstitutionGroup ret;
if (testDocLiteral) {
ret = docClient.testChoiceWithSubstitutionGroup(x, y, z);
} else if (testXMLBinding) {
ret = xmlClient.testChoiceWithSubstitutionGroup(x, y, z);
} else {
ret = rpcClient.testChoiceWithSubstitutionGroup(x, y, z);
}
if (!perfTestOnly) {
assertTrue("testChoiceWithSubstitutionGroup(): Incorrect value for inout param", equals(x, y.value));
assertTrue("testChoiceWithSubstitutionGroup(): Incorrect value for out param", equals(yOrig, z.value));
assertTrue("testChoiceWithSubstitutionGroup(): Incorrect return value", equals(x, ret));
}
}
use of org.apache.type_test.types3.ChoiceWithSubstitutionGroup in project cxf by apache.
the class AbstractTypeTestClient2 method equals.
// org.apache.type_test.types3.ChoiceWithSubstitutionGroup
protected boolean equals(SgBaseTypeA x, SgBaseTypeA y) {
if (x == null) {
return y == null;
} else if (y == null) {
return false;
}
if (x.getVarInt().compareTo(y.getVarInt()) != 0) {
return false;
}
if (x instanceof SgDerivedTypeC) {
if (y instanceof SgDerivedTypeC) {
SgDerivedTypeC xTypeC = (SgDerivedTypeC) x;
SgDerivedTypeC yTypeC = (SgDerivedTypeC) y;
return equals(xTypeC, yTypeC);
}
return false;
} else if (x instanceof SgDerivedTypeB) {
if (y instanceof SgDerivedTypeB) {
SgDerivedTypeB xTypeB = (SgDerivedTypeB) x;
SgDerivedTypeB yTypeB = (SgDerivedTypeB) y;
return equals(xTypeB, yTypeB);
}
return false;
}
return true;
}
use of org.apache.type_test.types3.ChoiceWithSubstitutionGroup in project cxf by apache.
the class AbstractTypeTestClient2 method equals.
protected boolean equals(ChoiceWithSubstitutionGroup x, ChoiceWithSubstitutionGroup y) {
if (x.getVarInt() != null && y.getVarInt() != null && x.getVarInt().compareTo(y.getVarInt()) == 0) {
return true;
}
if (!x.getSg01BaseElementA().isNil() && !y.getSg01BaseElementA().isNil()) {
SgBaseTypeA xTypeA = x.getSg01BaseElementA().getValue();
SgBaseTypeA yTypeA = y.getSg01BaseElementA().getValue();
return equals(xTypeA, yTypeA);
}
return false;
}
Aggregations