]> source.dussan.org Git - poi.git/commitdiff
Try to not fail if the time-webservice is offline temporarily
authorDominik Stadler <centic@apache.org>
Fri, 3 Jun 2016 06:01:27 +0000 (06:01 +0000)
committerDominik Stadler <centic@apache.org>
Fri, 3 Jun 2016 06:01:27 +0000 (06:01 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1746671 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSignatureInfo.java

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