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
This commit is contained in:
PJ Fanning 2024-07-01 23:19:33 +00:00
parent 7e86ff1bb0
commit 66f89c50d6
2 changed files with 7 additions and 2 deletions

View File

@ -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<String> EXPECTED_FAILURES = StressTestUtils.unmodifiableHashSet(

View File

@ -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