Search in sources :

Example 1 with AddNumbersException_Exception

use of org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception in project cxf by apache.

the class WSAFromJavaTest method testAddNumbersFault.

@Test
public void testAddNumbersFault() throws Exception {
    ByteArrayOutputStream input = setupInLogging();
    ByteArrayOutputStream output = setupOutLogging();
    AddNumberImpl port = getPort();
    try {
        port.addNumbers(-1, 2);
    } catch (AddNumbersException_Exception e) {
        assert true;
    } catch (Exception e) {
        e.printStackTrace();
        assert false;
    }
    assertTrue(output.toString().indexOf("http://cxf.apache.org/input") != -1);
    String expectedFault = "http://server.addr_fromjava.ws.systest.cxf.apache.org/AddNumberImpl/" + "addNumbers/Fault/AddNumbersException";
    assertTrue(input.toString(), input.toString().indexOf(expectedFault) != -1);
}
Also used : AddNumberImpl(org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl) AddNumbersException_Exception(org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AddNumbersException_Exception(org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) Test(org.junit.Test)

Example 2 with AddNumbersException_Exception

use of org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception in project cxf by apache.

the class WSAFromJavaTest method testAddNumbers3Fault.

@Test
public void testAddNumbers3Fault() throws Exception {
    ByteArrayOutputStream input = setupInLogging();
    ByteArrayOutputStream output = setupOutLogging();
    AddNumberImpl port = getPort();
    try {
        port.addNumbers3(-1, 2);
    } catch (AddNumbersException_Exception e) {
        assert true;
    } catch (Exception e) {
        e.printStackTrace();
        assert false;
    }
    assertTrue(output.toString(), output.toString().indexOf("http://cxf.apache.org/input") != -1);
    assertTrue(input.toString(), input.toString().indexOf("http://cxf.apache.org/fault3") != -1);
}
Also used : AddNumberImpl(org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl) AddNumbersException_Exception(org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception) ByteArrayOutputStream(java.io.ByteArrayOutputStream) AddNumbersException_Exception(org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception) SOAPFaultException(javax.xml.ws.soap.SOAPFaultException) Test(org.junit.Test)

Aggregations

ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 SOAPFaultException (javax.xml.ws.soap.SOAPFaultException)2 AddNumberImpl (org.apache.cxf.systest.ws.addr_fromjava.client.AddNumberImpl)2 AddNumbersException_Exception (org.apache.cxf.systest.ws.addr_fromjava.client.AddNumbersException_Exception)2 Test (org.junit.Test)2