From 639b847d6e92649f4e9349ab6bfaa43f1e0a6775 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Mon, 24 Aug 2015 08:12:01 +0000 Subject: [PATCH] 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 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 18 ++++++++++-------- .../ss/usermodel/BaseTestBugzillaIssues.java | 13 ++++++------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java index 00aa4b2f7..c36d8f7d3 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -741,6 +741,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { /** * Excel .xls style indexed colours in a .xlsx file */ + @SuppressWarnings("deprecation") @Test public void bug50786() throws Exception { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50786-indexed_colours.xlsx"); @@ -792,6 +793,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { * then being set explicitly still should allow the * fetching of the RGB. */ + @SuppressWarnings("deprecation") @Test public void bug50784() throws Exception { XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("50784-font_theme_colours.xlsx"); @@ -1802,7 +1804,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { // Now check the spreadsheet itself try { - new XSSFWorkbook(pkg); + new XSSFWorkbook(pkg).close(); fail("Should fail as too much expansion occurs"); } catch(POIXMLException e) { // Expected @@ -1848,7 +1850,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { // XSSF Workbook gives helpful error try { - new XSSFWorkbook(pkg); + new XSSFWorkbook(pkg).close(); fail(".xlsb files not supported"); } catch (XLSBUnsupportedException e) { // Good, detected and warned @@ -2359,7 +2361,7 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { public void bug57880() throws Exception { int numStyles = 33000; XSSFWorkbook wb = new XSSFWorkbook(); - XSSFSheet s = wb.createSheet("TestSheet"); + //XSSFSheet s = wb.createSheet("TestSheet"); XSSFDataFormat fmt = wb.getCreationHelper().createDataFormat(); for (int i=1; i