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
@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();
}
}