mirror of https://github.com/apache/poi.git
OOM fix for gump run
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1677913 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c233d8db79
commit
36156dc87b
|
@ -2463,7 +2463,17 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||
c.setCellValue(i);
|
||||
}
|
||||
|
||||
wb = XSSFTestDataSamples.writeOutAndReadBack(wb);
|
||||
// using temp file instead of ByteArrayOutputStream because of OOM in gump run
|
||||
File tmp = TempFile.createTempFile("poi-test", ".bug57880");
|
||||
FileOutputStream fos = new FileOutputStream(tmp);
|
||||
wb.write(fos);
|
||||
fos.close();
|
||||
|
||||
wb.close();
|
||||
fmt = null; s = null; wb = null;
|
||||
// System.gc();
|
||||
|
||||
wb = new XSSFWorkbook(tmp);
|
||||
fmt = wb.getCreationHelper().createDataFormat();
|
||||
s = wb.getSheetAt(0);
|
||||
for (int i=1; i<numStyles; i++) {
|
||||
|
@ -2473,5 +2483,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues {
|
|||
assertEquals(164+i, style.getDataFormat()&0xffff);
|
||||
assertEquals("test"+i, style.getDataFormatString());
|
||||
}
|
||||
wb.close();
|
||||
tmp.delete();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue