aboutsummaryrefslogtreecommitdiffstats
path: root/poi-ooxml
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2024-07-09 14:16:47 +0000
committerPJ Fanning <fanningpj@apache.org>2024-07-09 14:16:47 +0000
commitbfd4645a726c13eef376a5127c8aca4f40f5e8f6 (patch)
tree6e88e2fd270ab49f8da032a36a82b69df44e5584 /poi-ooxml
parentc1d6d0d4a1bc6215d8861a345503f1a1c951a49a (diff)
downloadpoi-bfd4645a726c13eef376a5127c8aca4f40f5e8f6.tar.gz
poi-bfd4645a726c13eef376a5127c8aca4f40f5e8f6.zip
add test case
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1919064 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml')
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
index 78c0eb1796..7926912f6c 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
@@ -1476,6 +1476,15 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
}
@Test
+ void testDuplicateFileCaseInsensitiveReadAsStream() {
+ assertThrows(InvalidZipException.class, () -> {
+ try (XSSFWorkbook wb = new XSSFWorkbook(openSampleFileStream("duplicate-filename-case-insensitive.xlsx"))) {
+ // expect exception here
+ }
+ });
+ }
+
+ @Test
void testWorkbookCloseClosesInputStream() throws Exception {
try (TrackingInputStream stream = new TrackingInputStream(
HSSFTestDataSamples.openSampleFileStream("github-321.xlsx"))) {