* Tests primitives (arguments, return types)
*/
@Test
public void test_primitivesSetter() {
try {
PrimitivesSetter primitivesSetter = new PrimitivesSetterServant();
TestRuntimeComponentService service = new TestRuntimeComponentService(primitivesSetter);
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/PrimitivesSetter:1.0"};
servant.setIds(ids);
bindServant(servant, "PrimitivesSetter");
PrimitivesSetter psClient = PrimitivesSetterHelper.narrow(bindReference("PrimitivesSetter"));
assertTrue(psClient.setBoolean(true) == true);
assertTrue(psClient.setChar('A') == 'A');
assertTrue(psClient.setString("SomeTest").equals("SomeTest"));
assertTrue(psClient.setDouble(2d) == 2d);
assertTrue(psClient.setFloat(3f) == 3f);
assertTrue(psClient.setLong(1) == 1);
assertTrue(psClient.setLongLong(0L) == 0L);
assertTrue(psClient.setOctet((byte)8) == (byte)8);
assertTrue(psClient.setShort((short)6) == (short)6);
assertTrue(psClient.setUnsignedLong(9) == 9);
assertTrue(psClient.setUnsignedLongLong(11L) == 11L);
assertTrue(psClient.setUnsignedShort((short)15) == (short)15);
} catch (Exception e) {
e.printStackTrace();
fail();
}
}