aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2020-12-30 21:40:01 +0000
committerDominik Stadler <centic@apache.org>2020-12-30 21:40:01 +0000
commit42c4e7d89ac33f4a71fd57d87666dd1a89bbf118 (patch)
treef633a79ee33cf12a8ef0cd281127689de3391e69
parent6a7003ff4fd66cce810e7c2cfd5bf281293bbe08 (diff)
downloadpoi-42c4e7d89ac33f4a71fd57d87666dd1a89bbf118.tar.gz
poi-42c4e7d89ac33f4a71fd57d87666dd1a89bbf118.zip
Add unfixed test for bug 64759 and make the ones fail which depend on manual opening of files in Microsoft Excel for verification
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1884957 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/integrationtest/org/apache/poi/stress/TestAllFiles.java1
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java15
-rw-r--r--test-data/spreadsheet/64759.xlsxbin0 -> 11679 bytes
3 files changed, 16 insertions, 0 deletions
diff --git a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
index cf059642a7..aa219bc2df 100644
--- a/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
+++ b/src/integrationtest/org/apache/poi/stress/TestAllFiles.java
@@ -251,6 +251,7 @@ public class TestAllFiles {
private static final Set<String> EXPECTED_FAILURES = unmodifiableHashSet(
// password protected files without known password
"spreadsheet/51832.xls",
+ "spreadsheet/64759.xlsx",
"document/PasswordProtected.doc",
// TODO: fails XMLExportTest, is this ok?
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
index 925a878a53..64d4c15f5f 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestUnfixedBugs.java
@@ -21,6 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -217,6 +218,8 @@ public final class TestUnfixedBugs {
// write to file for manual inspection
XSSFTestDataSamples.writeOut(wb, "bug 55752 for review");
}
+
+ fail("Test runs ok, but the resulting file is incorrectly formatted");
}
@Test
@@ -248,6 +251,8 @@ public final class TestUnfixedBugs {
checkRows57423(wbBack.getSheetAt(0));
wbBack.close();
+
+ fail("Excel reports that the workbook is corrupt");
}
private void checkRows57423(Sheet testSheet) throws IOException {
@@ -326,6 +331,8 @@ public final class TestUnfixedBugs {
// LibreOffice doesn't complain when rows are not in ascending order
wbBack.close();
+
+ fail("Excel reports that the workbook is corrupt, LibreOffice can read it");
}
}
@@ -387,4 +394,12 @@ public final class TestUnfixedBugs {
}
}
+
+ @Test
+ public void testBug64759() throws IOException {
+ try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("64759.xlsx")) {
+ Sheet cloned = wb.cloneSheet(0);
+ assertNotNull(cloned);
+ }
+ }
}
diff --git a/test-data/spreadsheet/64759.xlsx b/test-data/spreadsheet/64759.xlsx
new file mode 100644
index 0000000000..e7b47c94f0
--- /dev/null
+++ b/test-data/spreadsheet/64759.xlsx
Binary files differ