diff options
author | Dominik Stadler <centic@apache.org> | 2015-11-08 10:00:34 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2015-11-08 10:00:34 +0000 |
commit | 013583a8a70a423a5778a05f936e705a515a44a2 (patch) | |
tree | 1d048ac94c08f3e3478b03b0ab8287d00d031789 /src/integrationtest/org | |
parent | e15a3096d5a6a20cde576b9e844c00a92be494dc (diff) | |
download | poi-013583a8a70a423a5778a05f936e705a515a44a2.tar.gz poi-013583a8a70a423a5778a05f936e705a515a44a2.zip |
Add some more tests for the checks for files that can cause large memory usage.
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1713217 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/integrationtest/org')
-rw-r--r-- | src/integrationtest/org/apache/poi/TestAllFiles.java | 2 | ||||
-rw-r--r-- | src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/integrationtest/org/apache/poi/TestAllFiles.java b/src/integrationtest/org/apache/poi/TestAllFiles.java index 6231065e7f..9348c0593a 100644 --- a/src/integrationtest/org/apache/poi/TestAllFiles.java +++ b/src/integrationtest/org/apache/poi/TestAllFiles.java @@ -234,6 +234,8 @@ public class TestAllFiles { EXPECTED_FAILURES.add("spreadsheet/Simple.xlsb"); EXPECTED_FAILURES.add("poifs/unknown_properties.msg"); // POIFS properties corrupted EXPECTED_FAILURES.add("poifs/only-zero-byte-streams.ole2"); // No actual contents + EXPECTED_FAILURES.add("spreadsheet/poc-xmlbomb.xlsx"); // contains xml-entity-expansion + EXPECTED_FAILURES.add("spreadsheet/poc-shared-strings.xlsx"); // contains shared-string-entity-expansion // old Excel files, which we only support simple text extraction of EXPECTED_FAILURES.add("spreadsheet/testEXCEL_2.xls"); diff --git a/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java b/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java index f12bbd2de5..64e9805cb9 100644 --- a/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java +++ b/src/integrationtest/org/apache/poi/stress/SpreadsheetHandler.java @@ -69,12 +69,17 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler { } private void readContent(Workbook wb) { - for(int i = 0;i < wb.getNumberOfSheets();i++) { + for(int i = 0;i < wb.getNumberOfSheets();i++) { Sheet sheet = wb.getSheetAt(i); assertNotNull(wb.getSheet(sheet.getSheetName())); sheet.groupColumn((short) 4, (short) 5); sheet.setColumnGroupCollapsed(4, true); sheet.setColumnGroupCollapsed(4, false); + + // don't do this for very large sheets as it will take a long time + if(sheet.getPhysicalNumberOfRows() > 1000) { + continue; + } for(Row row : sheet) { for(Cell cell : row) { |