Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-3126

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 1.5.7
    • None
    • None
    • 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.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            codevise Dierk König
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: