float total = proxy.getQuote("BASE");
fail( "Expected BaseFault_Exception but no fault was thrown ");
}catch(BaseFault_Exception e){
BaseFault_Exception fault = (BaseFault_Exception) e;
BaseFault faultInfo = fault.getFaultInfo();
assertTrue(faultInfo != null);
assertTrue(faultInfo.getA() == 400);
} catch (Exception e) {
fail("Wrong exception thrown. Expected BaseFault_Exception but received " + e.getClass());
}
// Repeat to verify behavior
try{
// the invoke will throw an exception, if the test is performed right
float total = proxy.getQuote("BASE");
fail( "Expected BaseFault_Exception but no fault was thrown ");
}catch(BaseFault_Exception e){
BaseFault_Exception fault = (BaseFault_Exception) e;
BaseFault faultInfo = fault.getFaultInfo();
assertTrue(faultInfo != null);
assertTrue(faultInfo.getA() == 400);
} catch (Exception e) {
fail("Wrong exception thrown. Expected BaseFault_Exception but received " + e.getClass());
}
}