Object ret = objContext.getReturn();
assertNotNull(ret);
}
public void testUnmarshalMultipleMixedParams() throws Exception {
ObjectMessageContextImpl objContext = null;
CorbaMessageContextImpl corbaContext = null;
Class[] params = null;
// Prepare the arguments
params = new Class[3];
params[0] = short.class;
params[1] = new Holder<Short>().getClass();
params[2] = new Holder<Short>().getClass();
CorbaPrimitiveHandler handler0 = new CorbaPrimitiveHandler(new QName("p1"),
CorbaConstants.NT_CORBA_SHORT,
orb.get_primitive_tc(TCKind.tk_short),
null);
handler0.setValue(new Short((short)123));
CorbaStreamable arg0 = new CorbaStreamable(handler0, handler0.getName());
CorbaPrimitiveHandler handler1 = new CorbaPrimitiveHandler(new QName("p2"),
CorbaConstants.NT_CORBA_SHORT,
orb.get_primitive_tc(TCKind.tk_short),
null);
handler1.setValue(new Short((short)456));
CorbaStreamable arg1 = new CorbaStreamable(handler1, handler1.getName());
CorbaPrimitiveHandler handler2 = new CorbaPrimitiveHandler(new QName("p3"),
CorbaConstants.NT_CORBA_SHORT,
orb.get_primitive_tc(TCKind.tk_short),
null);
handler2.setValue(new Short((short)789));
CorbaStreamable arg2 = new CorbaStreamable(handler2, handler2.getName());
corbaContext = new CorbaMessageContextImpl(new GenericMessageContext());
corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
corbaContext.setMessage(new CorbaMessage());
corbaContext.getMessage().addStreamableArgument(arg0);
corbaContext.getMessage().addStreamableArgument(arg1);
corbaContext.getMessage().addStreamableArgument(arg2);
// First try call the operation using a void return type
objContext = new ObjectMessageContextImpl();
objContext.setMethod(paramModesClass.getMethod("testMultipleMixedParams", params));
Object[] objCtxArgs = new Object[3];
objCtxArgs[0] = (short)0;
objCtxArgs[1] = new Holder<Short>(new Short((short)0));
objCtxArgs[2] = new Holder<Short>(new Short((short)0));
objContext.setMessageObjects(objCtxArgs);
bindingImpl.unmarshal(corbaContext,
objContext,
new JAXBDataBindingCallback(objContext.getMethod(),
DataBindingCallback.Mode.MESSAGE,
null));
Object[] resultArgs = objContext.getMessageObjects();
assertTrue(resultArgs.length == 3);
// Now try the call with a return type
corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, false);
corbaContext.getMessage().setStreamableReturn(arg0);
objContext = new ObjectMessageContextImpl();
objContext.setMethod(paramModesClass.getMethod("testMultipleMixedParamsWithReturn", params));
objContext.setMessageObjects(objCtxArgs);
bindingImpl.unmarshal(corbaContext,
objContext,
new JAXBDataBindingCallback(objContext.getMethod(),
DataBindingCallback.Mode.MESSAGE,
null));
resultArgs = objContext.getMessageObjects();
assertTrue(resultArgs.length == 3);
Object ret = objContext.getReturn();
assertNotNull(ret);
}