From: Dominik Stadler Date: Mon, 24 Aug 2015 08:12:01 +0000 (+0000) Subject: Reduce required memory in tests by not actually creating all the rows/cells when... X-Git-Tag: REL_3_13_FINAL~89 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=465af8774331cee6991aa23691d7591ddebd3337;p=poi.git 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 --- 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 00aa4b2f75..c36d8f7d3e 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