Adjust to provide full exception information for cases where we catch unexpected exceptions

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1662447 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2015-02-26 13:43:10 +00:00
parent 66afa6d09b
commit b57a4f04e3

View File

@ -382,11 +382,13 @@ public class TestSignatureInfo {
si.confirmSignature();
} catch (RuntimeException e) {
// only allow a ConnectException because of timeout, we see this in Jenkins from time to time...
assertNotNull("Only allowing ConnectException here, but had: " + e, e.getCause());
if(e.getCause() == null) {
throw e;
}
if(!(e.getCause() instanceof ConnectException)) {
throw e;
}
assertTrue("Only allowing ConnectException here, but had: " + e, e.getCause().getMessage().contains("timed out"));
assertTrue("Only allowing ConnectException with 'timed out' as message here, but had: " + e, e.getCause().getMessage().contains("timed out"));
}
// verify