Groovy
  1. Groovy
  2. GROOVY-3126

Unit tests that rely on external static fields fail when executed through AllTestSuite

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.5.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Assume a unit test that contains a line like

        assertEquals 10, HelperClass.NUMBER
      

      and HelperClass is contains the line

       static final int NUMBER = 10
      

      then the test fails when executed through AllTestSuite because NUMBER has not been initialized but is still 0.
      HelperClass must be defined in a separate file. If it is declared within the same file, the test succeeds.

        Activity

        Mark Thomas made changes -
        Workflow jira [ 12970010 ] Default workflow, editable Closed status [ 12977770 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12732130 ] Default workflow, editable Closed status [ 12743947 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Jochen Theodorou made changes -
        Resolution Cannot Reproduce [ 5 ]
        Fix Version/s 1.7.x [ 15538 ]
        Status Open [ 1 ] Closed [ 6 ]
        Assignee blackdrag blackdrag [ blackdrag ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Fix Version/s 1.7-beta-x [ 15538 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.6.3 [ 15251 ]
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.6.3 [ 15251 ]
        Fix Version/s 1.6.2 [ 15151 ]
        Guillaume Delcroix made changes -
        Field Original Value New Value
        Fix Version/s 1.6.2 [ 15151 ]
        Fix Version/s 1.5.8 [ 14630 ]
        Dierk König created issue -

          People

          • Assignee:
            Jochen Theodorou
            Reporter:
            Dierk König
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development