aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2014-07-25 15:49:35 +0000
committerNick Burch <nick@apache.org>2014-07-25 15:49:35 +0000
commit8cf36ccc1ad2f6b600ff661f72b5f21e6352cb16 (patch)
treec6fcc1e880ad443f2c04d572613fffef2b1f9616 /src
parented4ee108b459e4adea6d6c2aebde0cbe78fc43ad (diff)
downloadpoi-8cf36ccc1ad2f6b600ff661f72b5f21e6352cb16.tar.gz
poi-8cf36ccc1ad2f6b600ff661f72b5f21e6352cb16.zip
Split the reference and area tests for #55906
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1613454 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r--src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
index 9199058ffb..9542c92691 100644
--- a/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
+++ b/src/ooxml/testcases/org/apache/poi/xssf/usermodel/TestXSSFFormulaEvaluation.java
@@ -184,8 +184,8 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
* Sheets 1 through Sheet 3).
* This test, based on common test files for HSSF and XSSF, checks
* that we can correctly evaluate these
- *
- * DISABLED pending support, see bug #55906
+ *
+ * TODO Fix this to pass for XSSF too, currently only passes for HSSF...
*/
public void DISABLEDtestMultiSheetReferencesHSSFandXSSF() throws Exception {
Workbook[] wbs = new Workbook[] {
@@ -201,7 +201,7 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
Cell sumF = s1.getRow(2).getCell(0);
assertNotNull(sumF);
assertEquals("SUM(Sheet1:Sheet3!A1)", sumF.getCellFormula());
- assertEquals("66.0", evaluator.evaluate(sumF).formatAsString());
+ assertEquals("Failed for " + wb.getClass(), "66.0", evaluator.evaluate(sumF).formatAsString());
// Various Stats formulas on numbers
@@ -241,7 +241,26 @@ public final class TestXSSFFormulaEvaluation extends BaseTestFormulaEvaluator {
assertNotNull(countA_3F);
assertEquals("COUNTA(Sheet1:Sheet3!E1)", countA_3F.getCellFormula());
assertEquals("3.0", evaluator.evaluate(countA_3F).formatAsString());
-
+ }
+ }
+ /**
+ * A handful of functions (such as SUM, COUNTA, MIN) support
+ * multi-sheet areas (eg Sheet1:Sheet3!A1:B2 = Cell A1 to Cell B2,
+ * from Sheets 1 through Sheet 3).
+ * This test, based on common test files for HSSF and XSSF, checks
+ * that we can correctly evaluate these
+ *
+ * DISABLED pending support, see bug #55906
+ */
+ public void DISABLEDtestMultiSheetAreasHSSFandXSSF() throws Exception {
+ Workbook[] wbs = new Workbook[] {
+ HSSFTestDataSamples.openSampleWorkbook("55906-MultiSheetRefs.xls"),
+ XSSFTestDataSamples.openSampleWorkbook("55906-MultiSheetRefs.xlsx")
+ };
+ for (Workbook wb : wbs) {
+ FormulaEvaluator evaluator = wb.getCreationHelper().createFormulaEvaluator();
+ Sheet s1 = wb.getSheetAt(0);
+
// SUM over a range
Cell sumFA = s1.getRow(2).getCell(7);