diff --git a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java index e6f181259..889b0dd1a 100644 --- a/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java +++ b/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java @@ -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