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 Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.5.7
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Number of attachments :
      0

      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

          People

          • Assignee:
            blackdrag blackdrag
            Reporter:
            Dierk König
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: