From 42441167fa300b192fa87826555ae0f88706e3ec Mon Sep 17 00:00:00 2001
From: Yegor Kozlov
Date: Tue, 28 Feb 2012 11:53:25 +0000
Subject: [PATCH] bugzilla 52057 - updated formula test framework to be aware
of recently added Functions
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1294595 13f79535-47bb-0310-9956-ffa450edef68
---
.../xdocs/spreadsheet/eval-devguide.xml | 19 +++++++++++++++++-
src/documentation/content/xdocs/status.xml | 1 +
.../ss/formula/functions/NumericFunction.java | 3 ++-
.../eval/TestFormulasFromSpreadsheet.java | 15 +++++++++++---
.../poi/ss/formula/functions/TestTrunc.java | 7 +++++++
test-data/spreadsheet/FormulaEvalTestData.xls | Bin 160768 -> 167936 bytes
.../spreadsheet/FormulaEvalTestData_Copy.xlsx | Bin 59230 -> 68870 bytes
7 files changed, 40 insertions(+), 5 deletions(-)
diff --git a/src/documentation/content/xdocs/spreadsheet/eval-devguide.xml b/src/documentation/content/xdocs/spreadsheet/eval-devguide.xml
index 551b2f1333..d59b8034b5 100644
--- a/src/documentation/content/xdocs/spreadsheet/eval-devguide.xml
+++ b/src/documentation/content/xdocs/spreadsheet/eval-devguide.xml
@@ -206,6 +206,23 @@
+ Testing Framework
+ Automated testing of the implemented Function is easy.
+ The source code for this is in the file: o.a.p.h.record.formula.GenericFormulaTestCase.java
+ This class has a reference to the test xls file (not /a/ test xls, /the/ test xls :)
+ which may need to be changed for your environment. Once you do that, in the test xls,
+ locate the entry for the function that you have implemented and enter different tests
+ in a cell in the FORMULA row. Then copy the "value of" the formula that you entered in the
+ cell just below it (this is easily done in excel as:
+ [copy the formula cell] > [go to cell below] > Edit > Paste Special > Values > "ok").
+ You can enter multiple such formulas and paste their values in the cell below and the
+ test framework will automatically test if the formula evaluation matches the expected
+ value (Again, hard to put in words, so if you will, please take time to quickly look
+ at the code and the currently entered tests in the patch attachment "FormulaEvalTestData.xls"
+ file).
+
+
+
Appendix A
@@ -354,4 +371,4 @@