]> source.dussan.org Git - poi.git/commitdiff
bug 56557: open test-data/spreadsheet/56557.xlsx such that the unit test test56557...
authorJaven O'Neal <onealj@apache.org>
Tue, 20 Jun 2017 06:08:38 +0000 (06:08 +0000)
committerJaven O'Neal <onealj@apache.org>
Tue, 20 Jun 2017 06:08:38 +0000 (06:08 +0000)
I verified that
> Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56557.xlsx")
and
> Workbook wb = WorkbookFactory.create(XSSFTestDataSamples.getSampleFile("56557.xlsx"), password=null, readOnly=false);
both fail when the fix from r1798913 for SXSSFWorkbook is not applied and both pass when the fix is applied.

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1799304 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/streaming/TestSXSSFWorkbook.java

index 9179362fa2add7fe14b9bcb1d3dd8c048bc2d301..c43f46e1adde3131d6c550e32a965fae03f31a38 100644 (file)
@@ -580,22 +580,16 @@ public final class TestSXSSFWorkbook extends BaseTestXWorkbook {
 
     @Test
     public void test56557() throws IOException, InvalidFormatException {
-        Workbook wb = WorkbookFactory.create(XSSFTestDataSamples.getSampleFile("56557.xlsx"), null, false);
+        Workbook wb = XSSFTestDataSamples.openSampleWorkbook("56557.xlsx");
 
         // Using streaming XSSFWorkbook makes the output file invalid
         wb = new SXSSFWorkbook(((XSSFWorkbook) wb));
 
+        // Should not throw POIXMLException: java.io.IOException: Unable to parse xml bean when reading back
         Workbook wbBack = XSSFTestDataSamples.writeOutAndReadBack(wb);
         assertNotNull(wbBack);
         wbBack.close();
 
-        /*FileOutputStream out = new FileOutputStream("C:/temp/out.xlsx");
-        try {
-            wb.write(out);
-        } finally {
-            out.close();
-        }*/
-
         wb.close();
     }
 }