diff options
Diffstat (limited to 'src/ooxml/testcases/org/apache')
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java | 3 | ||||
-rw-r--r-- | src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java index 25842cc556..35209dfada 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestPackage.java @@ -781,7 +781,8 @@ public final class TestPackage { } } - if(e.getMessage().startsWith("Zip bomb detected!")) { + String msg = e.getMessage(); + if(msg != null && msg.startsWith("Zip bomb detected!")) { return; } diff --git a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java index 74f5ea93e2..d292749e29 100644 --- a/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java +++ b/src/ooxml/testcases/org/apache/poi/openxml4j/opc/TestZipPackage.java @@ -67,6 +67,8 @@ public class TestZipPackage { assertTrue("Core not found in " + p.getParts(), foundCoreProps); assertFalse("Document should not be found in " + p.getParts(), foundDocument); assertFalse("Theme1 should not found in " + p.getParts(), foundTheme1); + p.close(); + is.close(); } @Test @@ -89,7 +91,7 @@ public class TestZipPackage { writer.close(); } String string = new String(str.toByteArray(), "UTF-8"); - assertTrue("Had: " + string, string.contains("Exceeded Entity dereference bytes limit")); + assertTrue("Had: " + string, string.contains("The parser has encountered more than")); } @Test |