/**
* Tests that that ComplxFaultFault is thrown
*/
public void testFaultsService3(){
FaultsServicePortType proxy = getProxy();
Exception exception = null;
try{
exception = null;
// the invoke will throw an exception, if the test is performed right
int total = proxy.throwFault(2, "Complex", 2); // "Complex" will cause service to throw ComplexFault_Exception
}catch(BaseFault_Exception e){
fail("Should not get BaseFault_Exception in this testcase");
} catch (ComplexFault_Exception e) {
exception = e;
}
TestLogger.logger.debug("----------------------------------");
assertNotNull(exception);
Object fault = ((ComplexFault_Exception)exception).getFaultInfo();
assertTrue(fault.getClass() == ComplexFault.class);
ComplexFault cf = (ComplexFault) fault;
assertTrue(cf.getA() == 2);
assertTrue(cf.getB().equals("Complex"));
assertTrue(cf.getC() == 2);
assertTrue(cf.getD() == 5);
// Repeat to verify behavior
try{
exception = null;
// the invoke will throw an exception, if the test is performed right
int total = proxy.throwFault(2, "Complex", 2); // "Complex" will cause service to throw ComplexFault_Exception
}catch(BaseFault_Exception e){
fail("Should not get BaseFault_Exception in this testcase");
} catch (ComplexFault_Exception e) {
exception = e;