Search in sources :

Example 6 with ServerRequest

use of org.omg.CORBA.ServerRequest in project cxf by apache.

the class CorbaServerConduitTest method testBuildRequestResultException.

@Test
public void testBuildRequestResultException() {
    NVList list = orb.create_list(0);
    CorbaServerConduit conduit = setupCorbaServerConduit(false);
    CorbaMessage msg = control.createMock(CorbaMessage.class);
    Exchange exchange = control.createMock(Exchange.class);
    ServerRequest request = control.createMock(ServerRequest.class);
    EasyMock.expect(msg.getExchange()).andReturn(exchange);
    EasyMock.expect(exchange.get(ServerRequest.class)).andReturn(request);
    EasyMock.expect(exchange.isOneWay()).andReturn(false);
    CorbaMessage inMsg = EasyMock.createMock(CorbaMessage.class);
    EasyMock.expect(msg.getExchange()).andReturn(exchange);
    EasyMock.expect(exchange.getInMessage()).andReturn(inMsg);
    EasyMock.expect(inMsg.getList()).andReturn(list);
    QName objName = new QName("object");
    QName objIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "short", CorbaConstants.NP_WSDL_CORBA);
    TypeCode objTypeCode = orb.get_primitive_tc(TCKind.tk_short);
    CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(objName, objIdlType, objTypeCode, null);
    CorbaStreamable exception = new CorbaStreamableImpl(obj, objName);
    EasyMock.expect(msg.getStreamableException()).andReturn(exception);
    EasyMock.expect(msg.getStreamableException()).andReturn(exception);
    control.replay();
    conduit.buildRequestResult(msg);
    control.verify();
}
Also used : Exchange(org.apache.cxf.message.Exchange) CorbaPrimitiveHandler(org.apache.cxf.binding.corba.types.CorbaPrimitiveHandler) CorbaStreamableImpl(org.apache.cxf.binding.corba.runtime.CorbaStreamableImpl) TypeCode(org.omg.CORBA.TypeCode) QName(javax.xml.namespace.QName) NVList(org.omg.CORBA.NVList) ServerRequest(org.omg.CORBA.ServerRequest) Test(org.junit.Test)

Example 7 with ServerRequest

use of org.omg.CORBA.ServerRequest in project cxf by apache.

the class CorbaServerConduitTest method testBuildRequestResult.

@Test
public void testBuildRequestResult() {
    NVList list = orb.create_list(0);
    CorbaServerConduit conduit = setupCorbaServerConduit(false);
    CorbaMessage msg = control.createMock(CorbaMessage.class);
    Exchange exchange = control.createMock(Exchange.class);
    ServerRequest request = control.createMock(ServerRequest.class);
    EasyMock.expect(msg.getExchange()).andReturn(exchange);
    EasyMock.expect(exchange.get(ServerRequest.class)).andReturn(request);
    EasyMock.expect(exchange.isOneWay()).andReturn(false);
    CorbaMessage inMsg = EasyMock.createMock(CorbaMessage.class);
    EasyMock.expect(msg.getExchange()).andReturn(exchange);
    EasyMock.expect(exchange.getInMessage()).andReturn(inMsg);
    EasyMock.expect(inMsg.getList()).andReturn(list);
    EasyMock.expect(msg.getStreamableException()).andReturn(null);
    EasyMock.expect(msg.getStreamableArguments()).andReturn(null);
    EasyMock.expect(msg.getStreamableReturn()).andReturn(null);
    control.replay();
    conduit.buildRequestResult(msg);
    control.verify();
}
Also used : Exchange(org.apache.cxf.message.Exchange) NVList(org.omg.CORBA.NVList) ServerRequest(org.omg.CORBA.ServerRequest) Test(org.junit.Test)

Aggregations

ServerRequest (org.omg.CORBA.ServerRequest)7 Exchange (org.apache.cxf.message.Exchange)5 NVList (org.omg.CORBA.NVList)5 QName (javax.xml.namespace.QName)4 Test (org.junit.Test)4 Any (org.omg.CORBA.Any)3 CorbaDestination (org.apache.cxf.binding.corba.CorbaDestination)2 CorbaStreamableImpl (org.apache.cxf.binding.corba.runtime.CorbaStreamableImpl)2 CorbaPrimitiveHandler (org.apache.cxf.binding.corba.types.CorbaPrimitiveHandler)2 TypeCode (org.omg.CORBA.TypeCode)2 HashMap (java.util.HashMap)1 CorbaMessage (org.apache.cxf.binding.corba.CorbaMessage)1 CorbaTypeMap (org.apache.cxf.binding.corba.CorbaTypeMap)1 TestUtils (org.apache.cxf.binding.corba.TestUtils)1 CorbaStreamReader (org.apache.cxf.binding.corba.runtime.CorbaStreamReader)1 CorbaTypeEventProducer (org.apache.cxf.binding.corba.types.CorbaTypeEventProducer)1 HandlerIterator (org.apache.cxf.binding.corba.types.HandlerIterator)1 ParameterEventProducer (org.apache.cxf.binding.corba.types.ParameterEventProducer)1 WrappedParameterSequenceEventProducer (org.apache.cxf.binding.corba.types.WrappedParameterSequenceEventProducer)1 OperationType (org.apache.cxf.binding.corba.wsdl.OperationType)1