aboutsummaryrefslogtreecommitdiffstats
path: root/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-08-24 08:12:01 +0000
committerDominik Stadler <centic@apache.org>2015-08-24 08:12:01 +0000
commit465af8774331cee6991aa23691d7591ddebd3337 (patch)
tree8773c20ac5b9796d91bf84b99ff6bd09a38a5c70 /src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
parent846057eca0bd09f1d493af154debe1d069d47c98 (diff)
downloadpoi-465af8774331cee6991aa23691d7591ddebd3337.tar.gz
poi-465af8774331cee6991aa23691d7591ddebd3337.zip
Reduce required memory in tests by not actually creating all the rows/cells when verifying the max number of cellstyles. Hopefully this will avoid the OOMs that we see in various CI environments currently while still verifying the limits correctly.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1697326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java')
-rw-r--r--src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
index a63e9db214..be36585be6 100644
--- a/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
+++ b/src/testcases/org/apache/poi/ss/usermodel/BaseTestBugzillaIssues.java
@@ -30,7 +30,6 @@ import java.io.IOException;
import java.text.AttributedString;
import java.util.HashMap;
import java.util.Map;
-import java.util.Random;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.PaneInformation;
@@ -1177,15 +1176,15 @@ public abstract class BaseTestBugzillaIssues {
public void bug58260() throws IOException {
//Create workbook and worksheet
Workbook wb = _testDataProvider.createWorkbook();
- Sheet worksheet = wb.createSheet("sample");
+ //Sheet worksheet = wb.createSheet("sample");
//Loop through and add all values from array list
// use a fixed seed to always produce the same file which makes comparing stuff easier
- Random rnd = new Random(4352345);
+ //Random rnd = new Random(4352345);
int maxStyles = (wb instanceof HSSFWorkbook) ? 4009 : 64000;
for(int i = 0;i < maxStyles;i++) {
//Create new row
- Row row = worksheet.createRow(i);
+ //Row row = worksheet.createRow(i);
//Create cell style
final CellStyle style;
@@ -1206,13 +1205,13 @@ public abstract class BaseTestBugzillaIssues {
}
//Create cell
- Cell cell = row.createCell(0);
+ //Cell cell = row.createCell(0);
//Set cell style
- cell.setCellStyle(style);
+ //cell.setCellStyle(style);
//Set cell value
- cell.setCellValue("r" + rnd.nextInt());
+ //cell.setCellValue("r" + rnd.nextInt());
}
// should fail if we try to add more now