diff options
author | Dominik Stadler <centic@apache.org> | 2019-01-13 17:14:24 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2019-01-13 17:14:24 +0000 |
commit | db14c353fc3b0089c597f92bcbf8315ecfa5c5c7 (patch) | |
tree | c66537eb71cfeacd7e2d289d32122117f7a477f2 /src/testcases/org/apache/poi/ss/formula | |
parent | 068c820ef432a7e5e2de549e5471979ffbcf9ea3 (diff) | |
download | poi-db14c353fc3b0089c597f92bcbf8315ecfa5c5c7.tar.gz poi-db14c353fc3b0089c597f92bcbf8315ecfa5c5c7.zip |
Fix some Findbugs and IDE issues, refactor some duplicated code,
improve some exception texts, add comment for missing Ptg for SxName
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1851210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases/org/apache/poi/ss/formula')
-rw-r--r-- | src/testcases/org/apache/poi/ss/formula/eval/forked/TestForkedEvaluator.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/testcases/org/apache/poi/ss/formula/eval/forked/TestForkedEvaluator.java b/src/testcases/org/apache/poi/ss/formula/eval/forked/TestForkedEvaluator.java index 3b9a53ff48..e27499ce39 100644 --- a/src/testcases/org/apache/poi/ss/formula/eval/forked/TestForkedEvaluator.java +++ b/src/testcases/org/apache/poi/ss/formula/eval/forked/TestForkedEvaluator.java @@ -18,6 +18,7 @@ package org.apache.poi.ss.formula.eval.forked; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import java.io.IOException; @@ -68,12 +69,7 @@ public class TestForkedEvaluator { Workbook wb = createWorkbook(); // The stability classifier is useful to reduce memory consumption of caching logic - IStabilityClassifier stabilityClassifier = new IStabilityClassifier() { - @Override - public boolean isCellFinal(int sheetIndex, int rowIndex, int columnIndex) { - return sheetIndex == 1; - } - }; + IStabilityClassifier stabilityClassifier = (sheetIndex, rowIndex, columnIndex) -> sheetIndex == 1; ForkedEvaluator fe1 = ForkedEvaluator.create(wb, stabilityClassifier, null); ForkedEvaluator fe2 = ForkedEvaluator.create(wb, stabilityClassifier, null); @@ -86,10 +82,16 @@ public class TestForkedEvaluator { fe2.updateCell("Inputs", 0, 0, new NumberEval(1.2)); fe2.updateCell("Inputs", 0, 1, new NumberEval(2.0)); - assertEquals(18.9, ((NumberEval) fe1.evaluate("Calculations", 0, 0)).getNumberValue(), 0.0); - assertEquals(4.0, ((NumberEval) fe2.evaluate("Calculations", 0, 0)).getNumberValue(), 0.0); + NumberEval eval1 = (NumberEval) fe1.evaluate("Calculations", 0, 0); + assertNotNull(eval1); + assertEquals(18.9, eval1.getNumberValue(), 0.0); + NumberEval eval2 = (NumberEval) fe2.evaluate("Calculations", 0, 0); + assertNotNull(eval2); + assertEquals(4.0, eval2.getNumberValue(), 0.0); fe1.updateCell("Inputs", 0, 0, new NumberEval(3.0)); - assertEquals(13.9, ((NumberEval) fe1.evaluate("Calculations", 0, 0)).getNumberValue(), 0.0); + eval1 = (NumberEval) fe1.evaluate("Calculations", 0, 0); + assertNotNull(eval1); + assertEquals(13.9, eval1.getNumberValue(), 0.0); wb.close(); } |