UIMA
  1. UIMA
  2. UIMA-1581

RegularExpressionAnnotator tests fail

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3S
    • Fix Version/s: 2.3.1Addons
    • Component/s: Sandbox-RegexAnnotator
    • Labels:
      None
    • Environment:

      MacOS X

      Description

      the following TestSetFeatureValues tests fail:

      • testSetFeatureValues1
      • testSetFeatureValues2
      • testSetFeatureValues3

        Issue Links

          Activity

          Tommaso Teofili created issue -
          Hide
          Thilo Goetz added a comment -

          Is this also due to EOL character issues?

          Show
          Thilo Goetz added a comment - Is this also due to EOL character issues?
          Hide
          Tommaso Teofili added a comment -

          yes, the same issue due to EOL character as in UIMA-1582.
          infact errors comes out at AnnotatorTester (uimaj-component-test-util) at line 432:
          "boolean isIdentical = FileCompare.compare(refFile, testFile);"
          this is used by TestSetFeatureValues

          Show
          Tommaso Teofili added a comment - yes, the same issue due to EOL character as in UIMA-1582 . infact errors comes out at AnnotatorTester (uimaj-component-test-util) at line 432: "boolean isIdentical = FileCompare.compare(refFile, testFile);" this is used by TestSetFeatureValues
          Hide
          Tommaso Teofili added a comment -

          The files generated in tests differ in two fields:

          • testFeature6 expected testFeature6=2343.34 but found actual 234334.0
          • testFeature7 expected testFeature7=2.4 but found actual 24.0
            So far I could not manage to find the reason for such a strange behaviour
          Show
          Tommaso Teofili added a comment - The files generated in tests differ in two fields: testFeature6 expected testFeature6=2343.34 but found actual 234334.0 testFeature7 expected testFeature7=2.4 but found actual 24.0 So far I could not manage to find the reason for such a strange behaviour
          Marshall Schor made changes -
          Field Original Value New Value
          Fix Version/s 2.3 [ 12312973 ]
          Marshall Schor made changes -
          Link This issue is part of UIMA-1582 [ UIMA-1582 ]
          Hide
          Marshall Schor added a comment -

          Tests run now on MacOS and Windows.

          Show
          Marshall Schor added a comment - Tests run now on MacOS and Windows.
          Marshall Schor made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Hide
          Tommaso Teofili added a comment -

          I found what this problem came from previously.
          This was due to NumberFormat.getInstance().parse(floatstring).floatValue() handling of decimal numbers strings like "2.4" which get converted as the float 2.4 on all those platform whose language specifies the period character (.) to be the separator between the integer part and the decimal portion of such a number while it fails with other languages (like Italian) where the separator is the comma character (,).

          The above piece of code performs a platform dependent conversion so since some tests have a string feature value like "2.4" it may fail on some platforms.

          Show
          Tommaso Teofili added a comment - I found what this problem came from previously. This was due to NumberFormat.getInstance().parse(floatstring).floatValue() handling of decimal numbers strings like "2.4" which get converted as the float 2.4 on all those platform whose language specifies the period character (.) to be the separator between the integer part and the decimal portion of such a number while it fails with other languages (like Italian) where the separator is the comma character (,). The above piece of code performs a platform dependent conversion so since some tests have a string feature value like "2.4" it may fail on some platforms.
          Hide
          Thilo Goetz added a comment -

          Nice catch. Can we run the test cases with an English locale? Maybe maven can handle this for us?

          Show
          Thilo Goetz added a comment - Nice catch. Can we run the test cases with an English locale? Maybe maven can handle this for us?
          Hide
          Tommaso Teofili added a comment -

          Yep Thilo, that can be done it via maven-surefire-plugin's argLine parameter

          Show
          Tommaso Teofili added a comment - Yep Thilo, that can be done it via maven-surefire-plugin's argLine parameter
          Tommaso Teofili made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Tommaso Teofili made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Tommaso Teofili made changes -
          Fix Version/s 2.3.1Addons [ 12316093 ]
          Marshall Schor made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Tommaso Teofili
              Reporter:
              Tommaso Teofili
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development