use of org.omg.CORBA.Context in project cxf by apache.
the class CorbaConduit method getRequest.
public Request getRequest(CorbaMessage message, String opName, org.omg.CORBA.NVList nvlist, org.omg.CORBA.NamedValue ret, org.omg.CORBA.ExceptionList exList) throws Exception {
Request request = null;
if (orb == null) {
prepareOrb();
}
ContextList ctxList = orb.create_context_list();
Context ctx = null;
try {
ctx = orb.get_default_context();
} catch (Exception ex) {
// ignore?
}
org.omg.CORBA.Object targetObj = (org.omg.CORBA.Object) message.get(CorbaConstants.CORBA_ENDPOINT_OBJECT);
if (targetObj != null) {
request = targetObj._create_request(ctx, opName, nvlist, ret, exList, ctxList);
}
return request;
}
use of org.omg.CORBA.Context in project cxf by apache.
the class CorbaConduitTest method testInvoke.
@Test
public void testInvoke() throws Exception {
CorbaConduit conduit = setupCorbaConduit(false);
// CorbaMessage message = new CorbaMessage(msg);
CorbaMessage message = control.createMock(CorbaMessage.class);
/*String opName = "GreetMe";
NVList nvlist = (NVList)orb.create_list(0);
Request request = conduit.getRequest(message, "GreetMe", nvlist, null, null);
request.invoke();
*/
org.omg.CORBA.Object obj = control.createMock(org.omg.CORBA.Object.class);
EasyMock.expect(message.get(CorbaConstants.CORBA_ENDPOINT_OBJECT)).andReturn(obj);
// msg.put(CorbaConstants.CORBA_ENDPOINT_OBJECT, obj);
Request r = control.createMock(Request.class);
NVList nvList = orb.create_list(0);
NamedValue ret = control.createMock(NamedValue.class);
ExceptionList exList = control.createMock(ExceptionList.class);
EasyMock.expect(obj._create_request((Context) EasyMock.anyObject(), EasyMock.eq("greetMe"), EasyMock.isA(NVList.class), EasyMock.isA(NamedValue.class), EasyMock.isA(ExceptionList.class), EasyMock.isA(ContextList.class)));
EasyMock.expectLastCall().andReturn(r);
r.invoke();
EasyMock.expectLastCall();
control.replay();
Request request = conduit.getRequest(message, "greetMe", nvList, ret, exList);
request.invoke();
control.verify();
/* try {
ContextList ctxList = orb.create_context_list();
Context ctx = orb.get_default_context();
org.omg.CORBA.Object targetObj = (org.omg.CORBA.Object)message
.get(CorbaConstants.CORBA_ENDPOINT_OBJECT);
Request request = targetObj._create_request(ctx, opName, list, ret, exList, ctxList);
request.invoke();
} catch (java.lang.Exception ex) {
ex.printStackTrace();
}*/
}
Aggregations