From 69015a079eeb351c95c9aed6da03a0647f664dac Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Mon, 4 Aug 2014 19:18:20 +0000 Subject: [PATCH] Add another test file for #54764, and a test that uses it git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1615731 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/xssf/usermodel/TestXSSFBugs.java | 18 +++++++++++++++--- test-data/spreadsheet/54764-2.xlsx | Bin 0 -> 8115 bytes 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 test-data/spreadsheet/54764-2.xlsx 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 a5420b0b79..64e199f83e 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -1860,9 +1860,21 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { // Now check the spreadsheet itself // TODO Fix then enable -// XSSFWorkbook wb = new XSSFWorkbook(pkg); -// XSSFSheet s = wb.getSheetAt(0); - // TODO Check +/* + try { + new XSSFWorkbook(pkg); + fail("Should fail as too much expansion occurs"); + } catch(POIXMLException e) { + // Expected + } */ + + // Try with one with the entities in the Content Types + try { + XSSFTestDataSamples.openSamplePackage("54764-2.xlsx"); + fail("Should fail as too much expansion occurs"); + } catch(Exception e) { + // Expected + } } /** diff --git a/test-data/spreadsheet/54764-2.xlsx b/test-data/spreadsheet/54764-2.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..0d942ca8d3a07028e2c568628ff1135ced8cc5f6 GIT binary patch literal 8115 zcmeI1bySq^w#NsCkdhFF5Trvoq+1$^p<_Tnx}+PVn?YKnJ0uiIN$C<5L~5i(Ksux( z?jRn;I6u$1_uo6Lnf1PF@qX5R_TKNazk5I6TRT1{0;F?4C&j3a`heT=nl9_f~mv^iEy9qM# z&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