@Test
public void test_passingUnions() {
try {
DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passRichUnion");
request.setOutputType(RichUnion.class);
RichUnion arg = new RichUnion();
InnerUnion argIu = new InnerUnion();
argIu.setX(10);
arg.setIu(argIu);
request.addArgument(arg);
DynaCorbaResponse response = request.invoke();
RichUnion result = (RichUnion)response.getContent();
assertEquals(arg.getIu().getX(), result.getIu().getX());
} catch (Exception e) {
e.printStackTrace();
fail();
}
try {
DynaCorbaRequest request = new DynaCorbaRequest(refArraysUnions, "passRichUnion");
request.setOutputType(RichUnion.class);
RichUnion arg = new RichUnion();
arg.setDef(true);
request.addArgument(arg);
DynaCorbaResponse response = request.invoke();
RichUnion result = (RichUnion)response.getContent();
assertEquals(arg.isDef(), result.isDef());
} catch (Exception e) {
e.printStackTrace();
fail();
}
}