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

KIE Workbench Test Scenario problems when using Float field in fact expectation

XMLWordPrintable

    • Hide
      1. Create a Data Object with a Float field type.
      2. Create a (Guided) Rule that inserts that fact, populating the Float field.
      3. Create a Test Scenario that triggers the rule and expects the fact is inserted with the float value.
      4. Run the test:
      • Values such as "1.0" will pass.
      • Values such as "0.8" will fail with:
        "Float equals : [FloatFact] field [value] was [0.8] expected [0.8]."
      • Values such as ".8" will fail with:
        "Float equals : String index out of range: 0"
      Show
      Create a Data Object with a Float field type. Create a (Guided) Rule that inserts that fact, populating the Float field. Create a Test Scenario that triggers the rule and expects the fact is inserted with the float value. Run the test: Values such as "1.0" will pass. Values such as "0.8" will fail with: "Float equals : [FloatFact] field [value] was [0.8] expected [0.8] ." Values such as ".8" will fail with: "Float equals : String index out of range: 0"
    • NEW
    • NEW

      Running a KIE Workbench Test Scenario that expects on a Float field type incorrectly fails on values such as "0.8" and ".8". Only values such as "1.0" pass.

      Using a Double field does not have this problem.

            Unassigned Unassigned
            jeffjensen_jira Jeff Jensen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: