Adjust TestSignatureInfo so junit provides more information if an unexpected exception happens

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1659784 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2015-02-14 12:46:04 +00:00
parent e7615fdd34
commit e450b8d5e1

View File

@ -383,7 +383,9 @@ public class TestSignatureInfo {
} 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());
assertTrue("Only allowing ConnectException here, but had: " + e, e.getCause() instanceof ConnectException);
if(!(e.getCause() instanceof ConnectException)) {
throw e;
}
assertTrue("Only allowing ConnectException here, but had: " + e, e.getCause().getMessage().contains("timed out"));
}