diff options
author | Nick Burch <nick@apache.org> | 2014-11-04 16:03:25 +0000 |
---|---|---|
committer | Nick Burch <nick@apache.org> | 2014-11-04 16:03:25 +0000 |
commit | 36142247f4becf7417c2f28251c71b27634025ad (patch) | |
tree | cbb6cb1418c1b008ebeaf59dcc8c4c081840a157 /src/testcases/org/apache | |
parent | 10e9daf4eb557cf152d611b1d2f5f4d4bfe4fffc (diff) | |
download | poi-36142247f4becf7417c2f28251c71b27634025ad.tar.gz poi-36142247f4becf7417c2f28251c71b27634025ad.zip |
More disabled unit tests relating to external workbook formula references
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1636626 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java index 2388f88aed..22e7ca5493 100644 --- a/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java +++ b/src/testcases/org/apache/poi/hssf/usermodel/TestHSSFFormulaEvaluator.java @@ -230,6 +230,36 @@ public final class TestHSSFFormulaEvaluator extends BaseTestFormulaEvaluator { assertEquals(Cell.CELL_TYPE_FORMULA, cell.getCellType()); assertEquals(Cell.CELL_TYPE_NUMERIC, cell.getCachedFormulaResultType()); assertEquals(36.90, cell.getNumericCellValue(), 0.0001); + +/* + // Now add a formula that refers to yet another (different) workbook + cell = wb.getSheetAt(0).getRow(1).createCell(42); + cell.setCellFormula("[alt.xls]Sheet1!$A$1"); + + // Check it - TODO Is this correct? Or should it become [2]Sheet1!$A$1 ? + assertEquals("[alt.xls]Sheet1!$A$1", cell.getCellFormula()); + + // Evaluate it, without a link to that workbook + try { + eval.evaluate(cell); + fail("No cached value and no link to workbook, shouldn't evaluate"); + } catch(Exception e) {} + + // Add a link, check it does + HSSFWorkbook alt = new HSSFWorkbook(); + alt.createSheet().createRow(0).createCell(0).setCellValue("In another workbook"); + HSSFFormulaEvaluator.setupEnvironment( + new String[] { "XRefCalc.xls", "XRefCalcData.xls", "alt.xls" }, + new HSSFFormulaEvaluator[] { + eval, + new HSSFFormulaEvaluator(wbData), + new HSSFFormulaEvaluator(alt) + } + ); + + eval.evaluate(cell); + assertEquals("In another workbook", cell.getStringCellValue()); +*/ } public void testSharedFormulas(){ |