use of org.apache.cxf.binding.corba.TestUtils in project cxf by apache.
the class CorbaDSIServantTest method testInvoke.
/*public void testCorbaDSIServant() throws Exception {
CorbaDestination destination = testUtils.getSimpleTypesTestDestination();
Service service = new ServiceImpl();
Endpoint endpoint = new EndpointImpl(bus, service, destination.getEndPointInfo());
MessageObserver observer = new ChainInitiationObserver(endpoint, bus);
destination.setMessageObserver(observer);
POA rootPOA = null;
CorbaDSIServant dsiServant = new CorbaDSIServant();
dsiServant.init(orb,
rootPOA,
destination,
observer);
assertNotNull("DSIServant should not be null", dsiServant != null);
assertNotNull("POA should not be null", dsiServant._default_POA() != null);
assertNotNull("Destination should not be null", dsiServant.getDestination() != null);
assertNotNull("ORB should not be null", dsiServant.getOrb() != null);
assertNotNull("MessageObserver should not be null", dsiServant.getObserver() != null);
byte[] objectId = new byte[10];
String[] interfaces = dsiServant._all_interfaces(rootPOA, objectId);
assertNotNull("Interfaces should not be null", interfaces != null);
assertEquals("Interface ID should be equal", interfaces[0], "IDL:Simple:1.0");
}*/
@Test
public void testInvoke() throws Exception {
CorbaDestination dest = new TestUtils().getComplexTypesTestDestination();
CorbaDSIServant dsiServant = new CorbaDSIServant();
dsiServant.init(orb, null, dest, null);
ServerRequest request = new ServerRequest() {
public String operation() {
return "greetMe";
}
public Context ctx() {
return null;
}
};
MessageObserver incomingObserver = new TestObserver();
dsiServant.setObserver(incomingObserver);
Map<String, QName> map = new HashMap<>(2);
map.put("greetMe", new QName("greetMe"));
dsiServant.setOperationMapping(map);
dsiServant.invoke(request);
}
Aggregations