]
Edson Tirelli updated DROOLS-1733:
----------------------------------
Sprint: 2017 Week 36-37
Enhance test coverage of FEEL built-in functions
------------------------------------------------
Key: DROOLS-1733
URL:
https://issues.jboss.org/browse/DROOLS-1733
Project: Drools
Issue Type: Bug
Components: dmn engine
Affects Versions: 7.3.0.Final
Reporter: Tibor Zimányi
Assignee: Tibor Zimányi
Labels: reported-by-qe
Fix For: 7.3.1.Final
Majority of classes in module kie-dmn-feel in package org.kie.dmn.feel.runtime.functions
can be tested by unit tests. Having such tests we can cover nearly 100% of these classes.
While coding these tests I found and fixed these bugs and problems:
* Rounding problem in EvalHelper.getBigDecimalOrNull() method - The method used
.doubleValue() call which produced rounding errors.
* AnyFunction and AllFunction didn't check if the items in the list parameter are all
Booleans (they must be according to the spec.)
* ConcatenateFunction didn't check for nulls in the list parameter
* EqualsFunction didn't compare BigDecimals with compareTo() method (which checks
just values and ignores scale)
* MinFunction and MaxFunction didn't check if the items in the list parameter are
comparable
* NumberFunction - split of one error message into two
* ReplaceFunction - NPE when having replacement param as null
* StringFunction and CodeFunction contained duplicated code
* SublistFunction - it was possible to input negative length as parameter
* ReplaceFunction now handles regexp flags
I will create a PR with new tests and fixes for mentioned things.