From 66f89c50d61d7fe6361eb85ec3d9af55e73f3e02 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 1 Jul 2024 23:19:33 +0000 Subject: [PATCH] try to stop poi-integration testing with corrupt file git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918805 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/org/apache/poi/stress/TestAllFiles.java | 6 ++++++ .../test/java/org/apache/poi/stress/XSSFFileHandler.java | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java index 1ab7d3dec0..c10cf7725e 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/TestAllFiles.java @@ -96,6 +96,9 @@ public class TestAllFiles { "poifs/protected_sha512.xlsx", "poifs/60320-protected.xlsx", "poifs/protected_sha512.xlsx", + + // corrupt file + "spreadsheet/duplicate-filename.xlsx" }; // cheap workaround of skipping the few problematic files @@ -145,6 +148,9 @@ public class TestAllFiles { "poifs/protected_sha512.xlsx", "poifs/60320-protected.xlsx", "poifs/protected_sha512.xlsx", + + // corrupt file + "spreadsheet/duplicate-filename.xlsx" }; private static final Set EXPECTED_FAILURES = StressTestUtils.unmodifiableHashSet( diff --git a/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java b/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java index f2067ed9a0..adebc94508 100644 --- a/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java +++ b/poi-integration/src/test/java/org/apache/poi/stress/XSSFFileHandler.java @@ -188,7 +188,6 @@ 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"); } @@ -204,7 +203,7 @@ public class XSSFFileHandler extends SpreadsheetHandler { XLSX2CSV.main(new String[]{file.getAbsolutePath()}); ExcelComparator.main(new String[]{file.getAbsolutePath(), file.getAbsolutePath()}); - assertFalse( EXPECTED_ADDITIONAL_FAILURES.contains(testFile), "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!" ); + assertFalse(EXPECTED_ADDITIONAL_FAILURES.contains(testFile), "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!" ); } catch (OLE2NotOfficeXmlFileException e) { // we have some files that are not actually OOXML and thus cannot be tested here -- 2.39.5