]> source.dussan.org Git - poi.git/commitdiff
rename file
authorPJ Fanning <fanningpj@apache.org>
Mon, 1 Jul 2024 22:50:04 +0000 (22:50 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 1 Jul 2024 22:50:04 +0000 (22:50 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918803 13f79535-47bb-0310-9956-ffa450edef68

poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java
poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java
test-data/spreadsheet/duplicate-file.xlsx [deleted file]
test-data/spreadsheet/duplicate-filename.xlsx [new file with mode: 0644]

index 1f75723c66cc2f13ec2039795e3f835a226e29fe..f2067ed9a0f019d2b1f91db8eb5486c4d3b86adf 100644 (file)
@@ -188,6 +188,7 @@ public class XSSFFileHandler extends SpreadsheetHandler {
         EXPECTED_ADDITIONAL_FAILURES.add("spreadsheet/sample-beta.xlsx");
 
         // corrupt/invalid
+        EXPECTED_ADDITIONAL_FAILURES.add("spreadsheet/duplicate-filename.xlsx");
         EXPECTED_ADDITIONAL_FAILURES.add("openxml4j/invalid.xlsx");
     }
 
index 854798f16ff462202bc53dacb28ead284fe4238a..78c0eb1796d27c0cad1ea07e78066ec3c95f0207 100644 (file)
@@ -1451,7 +1451,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
     @Test
     void testDuplicateFileReadAsOPCFile() {
         assertThrows(InvalidFormatException.class, () -> {
-            try (OPCPackage pkg = OPCPackage.open(getSampleFile("duplicate-file.xlsx"), PackageAccess.READ)) {
+            try (OPCPackage pkg = OPCPackage.open(getSampleFile("duplicate-filename.xlsx"), PackageAccess.READ)) {
                 // expect exception here
             }
         });
@@ -1460,7 +1460,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
     @Test
     void testDuplicateFileReadAsFile() {
         assertThrows(InvalidFormatException.class, () -> {
-            try (XSSFWorkbook wb = new XSSFWorkbook(getSampleFile("duplicate-file.xlsx"))) {
+            try (XSSFWorkbook wb = new XSSFWorkbook(getSampleFile("duplicate-filename.xlsx"))) {
                 // expect exception here
             }
         });
@@ -1469,7 +1469,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook {
     @Test
     void testDuplicateFileReadAsStream() {
         assertThrows(InvalidZipException.class, () -> {
-            try (XSSFWorkbook wb = new XSSFWorkbook(openSampleFileStream("duplicate-file.xlsx"))) {
+            try (XSSFWorkbook wb = new XSSFWorkbook(openSampleFileStream("duplicate-filename.xlsx"))) {
                 // expect exception here
             }
         });
diff --git a/test-data/spreadsheet/duplicate-file.xlsx b/test-data/spreadsheet/duplicate-file.xlsx
deleted file mode 100644 (file)
index 5853cf1..0000000
Binary files a/test-data/spreadsheet/duplicate-file.xlsx and /dev/null differ
diff --git a/test-data/spreadsheet/duplicate-filename.xlsx b/test-data/spreadsheet/duplicate-filename.xlsx
new file mode 100644 (file)
index 0000000..5853cf1
Binary files /dev/null and b/test-data/spreadsheet/duplicate-filename.xlsx differ