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 942841bcc..31a54bf14 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFBugs.java @@ -3049,4 +3049,22 @@ public final class TestXSSFBugs extends BaseTestBugzillaIssues { nwb.close(); } + + @Ignore("currently fails on POI 3.15 beta 2") + @Test + public void test55273() { + Workbook wb = XSSFTestDataSamples.openSampleWorkbook("ExcelTables.xlsx"); + Sheet sheet = wb.getSheet("ExcelTable"); + + Name name = wb.getName("TableAsRangeName"); + assertEquals("TableName[#All]", name.getRefersToFormula()); + // POI 3.15-beta 2 (2016-06-15): getSheetName throws IllegalArgumentException: Invalid CellReference: TableName[#All] + assertEquals("TableName", name.getSheetName()); + + XSSFSheet xsheet = (XSSFSheet) sheet; + List tables = xsheet.getTables(); + assertEquals(2, tables.size()); //FIXME: how many tables are there in this spreadsheet? + assertEquals("Table1", tables.get(0).getName()); //FIXME: what is the table name? + assertEquals("Table2", tables.get(1).getName()); //FIXME: what is the table name? + } } diff --git a/test-data/spreadsheet/ExcelTables.xlsx b/test-data/spreadsheet/ExcelTables.xlsx new file mode 100644 index 000000000..6d9544687 Binary files /dev/null and b/test-data/spreadsheet/ExcelTables.xlsx differ