public void testErrorHandling() {
String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
String trpUrl = "http://localhost:8280";
log.info("Running test: Introduction to error handling");
SampleClientResult result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM" ,null);
assertResponseReceived(result);
result = client.requestStandardQuote(addUrl, trpUrl, null, "MSFT" ,null);
assertFalse("Must not get a response", result.responseReceived());
Exception resultEx = result.getException();
assertNotNull("Did not receive expected error" , resultEx);
log.info("Got an error as expected: " + resultEx.getMessage());
assertTrue("Did not receive expected error", resultEx instanceof AxisFault);
result = client.requestStandardQuote(addUrl, trpUrl, null, "SUN" ,null);
assertFalse("Must not get a response", result.responseReceived());
Exception resultEx2 = result.getException();
assertNotNull("Did not receive expected error" , resultEx);
log.info("Got an error as expected: " + resultEx.getMessage());
assertTrue("Did not receive expected error", resultEx2 instanceof AxisFault);
}