From: Nick Burch Date: Fri, 18 Jul 2014 23:02:51 +0000 (+0000) Subject: Stub the unit test which is the next thing to need to work for progress on #56737 X-Git-Tag: REL_3_11_BETA1~93 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8f33d9790a4e1f15465b35d3ed6d5ad0dffadd0c;p=poi.git Stub the unit test which is the next thing to need to work for progress on #56737 git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1611833 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java index 9b90102003..deec6ef28c 100644 --- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java +++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java @@ -19,13 +19,14 @@ package org.apache.poi.xssf.usermodel; import junit.framework.TestCase; -import org.apache.poi.ss.formula.ptg.Ptg; -import org.apache.poi.ss.formula.ptg.RefPtg; -import org.apache.poi.ss.formula.ptg.IntPtg; -import org.apache.poi.ss.formula.ptg.FuncPtg; import org.apache.poi.ss.formula.FormulaParseException; import org.apache.poi.ss.formula.FormulaParser; import org.apache.poi.ss.formula.FormulaType; +import org.apache.poi.ss.formula.ptg.FuncPtg; +import org.apache.poi.ss.formula.ptg.IntPtg; +import org.apache.poi.ss.formula.ptg.Ptg; +import org.apache.poi.ss.formula.ptg.RefPtg; +import org.apache.poi.xssf.XSSFTestDataSamples; public final class TestXSSFFormulaParser extends TestCase { @@ -88,4 +89,26 @@ public final class TestXSSFFormulaParser extends TestCase { assertTrue("", ptgs[0] instanceof IntPtg); assertTrue("", ptgs[1] instanceof FuncPtg); } + + public void DISABLEDtestFormulaReferencesOtherWorkbook() { + // Use a test file with the external linked table in place + XSSFWorkbook wb = XSSFTestDataSamples.openSampleWorkbook("ref-56737.xlsx"); + XSSFEvaluationWorkbook fpb = XSSFEvaluationWorkbook.create(wb); + Ptg[] ptgs; + + // Reference to a single cell in a different workbook + ptgs = parse(fpb, "[1]Uses!$A$1"); + assertEquals(1, ptgs.length); + // TODO assert + + // Reference to a sheet-scoped named range in a different workbook + ptgs = parse(fpb, "[1]Defines!NR_To_A1"); + assertEquals(1, ptgs.length); + // TODO assert + + // Reference to a global named range in a different workbook + ptgs = parse(fpb, "[1]!NR_Global_B2"); + assertEquals(1, ptgs.length); + // TODO assert + } }