* Tests structures (arguments, return types)
*/
@Test
public void test_TestObject_setStruct() {
try {
TestObject to = new TestObjectServant();
TestRuntimeComponentService service = new TestRuntimeComponentService(to);
Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
String[] ids = new String[] {"IDL:org/apache/tuscany/sca/binding/corba/testing/generated/TestObject:1.0"};
servant.setIds(ids);
bindServant(servant, "TestObject");
TestObject testObject = TestObjectHelper.narrow(bindReference("TestObject"));
SomeStruct ss = new SomeStruct();
SimpleStruct inner = new SimpleStruct();
inner.field1 = TestConstants.STR_1;
inner.field2 = TestConstants.INT_1;
ss.innerStruct = inner;
ss.str = TestConstants.STR_2;
ss.str_list = TestConstants.STR_ARR_1;
ss.threeDimSeq = TestConstants.INT_ARRAY_3_DIM;
ss.twoDimSeq = TestConstants.INT_ARRAY_2_DIM;
SomeStruct result = testObject.setStruct(ss);
assertTrue(TestConstants.are2DimArraysEqual(result.twoDimSeq, TestConstants.INT_ARRAY_2_DIM));
assertTrue(TestConstants.are3DimArraysEqual(result.threeDimSeq, TestConstants.INT_ARRAY_3_DIM));
assertTrue(result.str.equals(ss.str));
assertTrue(result.innerStruct.field1.equals(ss.innerStruct.field1));
assertTrue(result.innerStruct.field2 == ss.innerStruct.field2);