poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1677913 - /poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
Date Tue, 05 May 2015 23:51:10 GMT
Author: kiwiwings
Date: Tue May  5 23:51:10 2015
New Revision: 1677913

URL: http://svn.apache.org/r1677913
Log:
OOM fix for gump run

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java?rev=1677913&r1=1677912&r2=1677913&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java Tue May
 5 23:51:10 2015
@@ -2463,7 +2463,17 @@ public final class TestXSSFBugs extends
             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
             assertEquals(164+i, style.getDataFormat()&0xffff);
             assertEquals("test"+i, style.getDataFormatString());
         }
+        wb.close();
+        tmp.delete();
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message