Try to not fail if the time-webservice is offline temporarily

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1746671 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2016-06-03 06:01:27 +00:00
parent 52537ae58e
commit 1caa8ff288
1 changed files with 7 additions and 3 deletions

View File

@ -388,11 +388,15 @@ public class TestSignatureInfo {
if(e.getCause() == null) {
throw e;
}
if(!(e.getCause() instanceof ConnectException) && !(e.getCause() instanceof SocketTimeoutException)) {
if((e.getCause() instanceof ConnectException) || (e.getCause() instanceof SocketTimeoutException)) {
assertTrue("Only allowing ConnectException with 'timed out' as message here, but had: " + e,
e.getCause().getMessage().contains("timed out"));
} else if (e.getCause() instanceof RuntimeException) {
assertTrue("Only allowing RuntimeException with 'This site is cur' as message here, but had: " + e,
e.getCause().getMessage().contains("This site is cur"));
} else {
throw e;
}
assertTrue("Only allowing ConnectException with 'timed out' as message here, but had: " + e,
e.getCause().getMessage().contains("timed out"));
}
// verify