]> source.dussan.org Git - poi.git/commitdiff
Stub the unit test which is the next thing to need to work for progress on #56737
authorNick Burch <nick@apache.org>
Fri, 18 Jul 2014 23:02:51 +0000 (23:02 +0000)
committerNick Burch <nick@apache.org>
Fri, 18 Jul 2014 23:02:51 +0000 (23:02 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1611833 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaParser.java

index 9b901020034860fdb82157e5424d76fbf4062882..deec6ef28ca600d505bcfc1bc0a9be19fe56b5fb 100644 (file)
@@ -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
+    }
 }