use of org.apache.cxf.hello_world_corba.GreeterCORBAService in project cxf by apache.
the class CorbaTest method testException.
@Test
public void testException() throws Exception {
System.getProperties().remove("com.sun.CORBA.POA.ORBServerId");
System.getProperties().remove("com.sun.CORBA.POA.ORBPersistentServerPort");
URL wsdlUrl = this.getClass().getResource("/wsdl_systest/hello_world_corba.wsdl");
new SpringBusFactory().createBus("org/apache/cxf/systest/corba/hello_world_client.xml");
GreeterCORBAService gcs = new GreeterCORBAService(wsdlUrl, SERVICE_NAME);
Greeter port = gcs.getGreeterCORBAPort();
try {
port.pingMe("USER");
} catch (PingMeFault pe) {
return;
} catch (Exception e) {
e.printStackTrace();
return;
}
fail("Didn't catch an exception");
}
use of org.apache.cxf.hello_world_corba.GreeterCORBAService in project cxf by apache.
the class CorbaTest method testClientServer.
@Test
public void testClientServer() throws Exception {
System.getProperties().remove("com.sun.CORBA.POA.ORBServerId");
System.getProperties().remove("com.sun.CORBA.POA.ORBPersistentServerPort");
URL wsdlUrl = this.getClass().getResource("/wsdl_systest/hello_world_corba.wsdl");
new SpringBusFactory().createBus("org/apache/cxf/systest/corba/hello_world_client.xml");
GreeterCORBAService gcs = new GreeterCORBAService(wsdlUrl, SERVICE_NAME);
Greeter port = gcs.getGreeterCORBAPort();
String output = port.greetMe("Betty");
assertEquals("Unexpected returned string: " + output, "Hello Betty", output);
}
use of org.apache.cxf.hello_world_corba.GreeterCORBAService in project cxf by apache.
the class CorbaTimeoutTest method testTimeout.
@Test
public void testTimeout() throws Exception {
System.getProperties().remove("com.sun.CORBA.POA.ORBServerId");
System.getProperties().remove("com.sun.CORBA.POA.ORBPersistentServerPort");
String orbClass = System.getProperty("org.omg.CORBA.ORBClass");
System.setProperty("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
System.setProperty("org.omg.CORBA.ORBSingletonClass", "org.jacorb.orb.ORBSingleton");
System.setProperty("jacorb.connection.client.pending_reply_timeout", "1000");
URL wsdlUrl = this.getClass().getResource("/wsdl_systest/hello_world_corba_timeout.wsdl");
new SpringBusFactory().createBus("org/apache/cxf/systest/corba/hello_world_client.xml");
GreeterCORBAService gcs = new GreeterCORBAService(wsdlUrl, SERVICE_NAME);
Greeter port = gcs.getPort(new QName("http://cxf.apache.org/hello_world_corba", "GreeterTimeoutCORBAPort"), GreeterCORBAService.GreeterProxy.class);
try {
port.greetMe("Betty");
fail("Should throw org.omg.CORBA.TIMEOUT exception");
} catch (WebServiceException e) {
assertTrue(e.getCause() instanceof TIMEOUT);
} finally {
System.getProperties().remove("org.omg.CORBA.ORBClass");
System.getProperties().remove("org.omg.CORBA.ORBSingletonClass");
if (orbClass != null) {
System.setProperty("org.omg.CORBA.ORBClass", orbClass);
}
}
}
Aggregations