use of org.apache.type_test.types3.SgBaseTypeA 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.SgBaseTypeA 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(BigInteger.ONE);
SgDerivedTypeB derivedB = new SgDerivedTypeB();
derivedB.setVarInt(new BigInteger("32"));
derivedB.setVarString("y-SgDerivedTypeB");
SgDerivedTypeC derivedC = new SgDerivedTypeC();
derivedC.setVarInt(BigInteger.ONE);
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(BigInteger.TEN);
yOrig.setVarString("y-varString");
yOrig.setSg01BaseElementA(y1);
yOrig.setSg02BaseElementA(y2);
Holder<StructWithMultipleSubstitutionGroups> y = new Holder<>(yOrig);
Holder<StructWithMultipleSubstitutionGroups> z = new Holder<>();
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));
}
}
use of org.apache.type_test.types3.SgBaseTypeA in project cxf by apache.
the class AbstractTypeTestClient2 method testChoiceWithSubstitutionGroupNil.
@Test
public void testChoiceWithSubstitutionGroupNil() throws Exception {
if (!shouldRunTest("ChoiceWithSubstitutionGroupNil")) {
return;
}
ObjectFactory objectFactory = new ObjectFactory();
ChoiceWithSubstitutionGroupNil x = new ChoiceWithSubstitutionGroupNil();
JAXBElement<BigInteger> varInt = objectFactory.createChoiceWithSubstitutionGroupNilVarInt(null);
x.setVarInt(varInt);
ChoiceWithSubstitutionGroupNil yOrig = new ChoiceWithSubstitutionGroupNil();
JAXBElement<? extends SgBaseTypeA> elementA = objectFactory.createSg04NillableBaseElementA(null);
yOrig.setSg04NillableBaseElementA(elementA);
Holder<ChoiceWithSubstitutionGroupNil> y = new Holder<>(yOrig);
Holder<ChoiceWithSubstitutionGroupNil> z = new Holder<>();
ChoiceWithSubstitutionGroupNil ret;
if (testDocLiteral) {
ret = docClient.testChoiceWithSubstitutionGroupNil(x, y, z);
} else if (testXMLBinding) {
ret = xmlClient.testChoiceWithSubstitutionGroupNil(x, y, z);
} else {
ret = rpcClient.testChoiceWithSubstitutionGroupNil(x, y, z);
}
if (!perfTestOnly) {
assertTrue("testChoiceWithSubstitutionGroupNil(): Incorrect value for inout param", equals(x, y.value));
assertTrue("testChoiceWithSubstitutionGroupNil(): Incorrect value for out param", equals(yOrig, z.value));
assertTrue("testChoiceWithSubstitutionGroupNil(): Incorrect return value", equals(x, ret));
}
}
use of org.apache.type_test.types3.SgBaseTypeA 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(BigInteger.ONE);
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<>(yOrig);
Holder<ChoiceWithSubstitutionGroup> z = new Holder<>();
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.SgBaseTypeA 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(BigInteger.ONE);
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<>(yOrig);
Holder<StructWithSubstitutionGroup> z = new Holder<>();
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));
}
}
Aggregations