use of org.apache.cxf.hello_world_corba.PingMeFault in project cxf by apache.
the class BaseGreeterImpl method pingMe.
public void pingMe(String faultType) throws PingMeFault {
if ("USER".equals(faultType)) {
FaultDetail detail = new FaultDetail();
detail.setMajor((short) 1);
detail.setMinor((short) 2);
throw new PingMeFault("USER FAULT TEST", detail);
} else if ("SYSTEM".equals(faultType)) {
throw new Fault(new Message(EX_STRING, (ResourceBundle) null, new Object[] { "FAULT TEST" }));
} else {
throw new IllegalArgumentException(EX_STRING);
}
}
use of org.apache.cxf.hello_world_corba.PingMeFault 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");
}
Aggregations