assertNotNull(ret);
assertTrue(ret.getObject().getTypeCodeKind().value() == TCKind._tk_short);
}
public void testMarshalMultipleMixedParams() throws Exception {
ObjectMessageContextImpl objContext = null;
CorbaMessageContextImpl corbaContext = null;
Class[] params = null;
// First try call the operation using a void return type
params = new Class[3];
params[0] = short.class;
params[1] = new Holder<Short>().getClass();
params[2] = new Holder<Short>().getClass();
objContext = new ObjectMessageContextImpl();
objContext.setMethod(paramModesClass.getMethod("testMultipleMixedParams", params));
Object[] paramObjs = new Object[3];
paramObjs[0] = (short)123;
paramObjs[1] = new Holder<Short>((short)456);
paramObjs[2] = new Holder<Short>((short)789);
objContext.setMessageObjects(paramObjs);
corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
bindingImpl.marshal(objContext,
corbaContext,
new JAXBDataBindingCallback(objContext.getMethod(),
DataBindingCallback.Mode.MESSAGE,
null));
// Verify that everything was marshalled correctly
CorbaStreamable[] streamables = corbaContext.getMessage().getStreamableArguments();
assertTrue(streamables.length == 3);
CorbaStreamable param0 = streamables[0];
assertTrue(param0.getObject().getTypeCodeKind().value() == TCKind._tk_short);
assertTrue(param0.getMode() == ARG_IN.value);
CorbaStreamable param1 = streamables[1];
assertTrue(param1.getObject().getTypeCodeKind().value() == TCKind._tk_short);
assertTrue(param1.getMode() == ARG_OUT.value);
CorbaStreamable param2 = streamables[2];
assertTrue(param2.getObject().getTypeCodeKind().value() == TCKind._tk_short);
assertTrue(param2.getMode() == ARG_INOUT.value);
// Now try the call with a return value
objContext = new ObjectMessageContextImpl();
objContext.setMethod(paramModesClass.getMethod("testMultipleMixedParamsWithReturn", params));
objContext.setMessageObjects(paramObjs);
corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
bindingImpl.marshal(objContext,
corbaContext,
new JAXBDataBindingCallback(objContext.getMethod(),
DataBindingCallback.Mode.MESSAGE,
null));
// Verify that everything was marshalled correctly
streamables = corbaContext.getMessage().getStreamableArguments();