Search in sources :

Example 6 with Greeter

use of org.apache.hello_world_soap12_http.Greeter in project cxf by apache.

the class Soap12ClientServerTest method testPingMeFault.

@Test
public void testPingMeFault() throws Exception {
    Greeter greeter = getGreeter();
    try {
        greeter.pingMe();
        fail("Should throw Exception!");
    } catch (PingMeFault ex) {
        FaultDetail detail = ex.getFaultInfo();
        assertEquals((short) 2, detail.getMajor());
        assertEquals((short) 1, detail.getMinor());
        assertEquals("PingMeFault raised by server", ex.getMessage());
        StackTraceElement[] element = ex.getStackTrace();
        assertEquals("org.apache.cxf.systest.soapfault.details.GreeterImpl12", element[0].getClassName());
    }
}
Also used : PingMeFault(org.apache.hello_world_soap12_http.PingMeFault) Greeter(org.apache.hello_world_soap12_http.Greeter) FaultDetail(org.apache.hello_world_soap12_http.types.FaultDetail) Test(org.junit.Test)

Aggregations

Greeter (org.apache.hello_world_soap12_http.Greeter)6 Test (org.junit.Test)4 URL (java.net.URL)2 PingMeFault (org.apache.hello_world_soap12_http.PingMeFault)2 SOAPService (org.apache.hello_world_soap12_http.SOAPService)2 FaultDetail (org.apache.hello_world_soap12_http.types.FaultDetail)2 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)1