Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-1733

Enhance test coverage of FEEL built-in functions

    XMLWordPrintable

Details

    • 2017 Week 36-37
    • NEW
    • NEW

    Description

      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.

      Attachments

        Activity

          People

            tzimanyi@redhat.com Tibor Zimányi
            tzimanyi@redhat.com Tibor Zimányi
            Tibor Zimányi Tibor Zimányi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: