public void test_nonCorbaServants() {
try {
NonCorbaServant ncs = new NonCorbaServant();
TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
bindServant(servant, "NonCorbaServant");
// it's non corba servant so we don't have stubs to test them
DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "setString");
request.addArgument(TestConstants.STR_1);
request.setOutputType(String.class);
DynaCorbaResponse response = request.invoke();
assertTrue(response.getContent().equals(TestConstants.STR_1));
} catch (Exception e) {
e.printStackTrace();
fail();
}
try {
NonCorbaServant ncs = new NonCorbaServant();
TestRuntimeComponentService service = new TestRuntimeComponentService(ncs);
Class<?> javaClass = ((JavaInterface)service.getInterfaceContract().getInterface()).getJavaClass();
InvocationProxy proxy = new ComponentInvocationProxy(service, service.getRuntimeWire(null), javaClass);
DynaCorbaServant servant = new DynaCorbaServant(proxy, Utils.getTypeId(javaClass));
bindServant(servant, "NonCorbaServant");
// it's non corba servant so we don't have stubs to test them
DynaCorbaRequest request = new DynaCorbaRequest(bindReference("NonCorbaServant"), "throwException");
request.addExceptionType(NonCorbaException.class);