Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 1.5.7
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Number of attachments :
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.
ok, so I made a file XX.groovy with
class XX { static final int NUMBER = 10 }And in a another file I have
assert 10, XX.NUMBERExecuting the later script works just fine. So next I made a test subdirectory and transfered the script into a test case. Then I did junit.textui.TestRunner.run(AllTestSuite.suite()) and it ran just fine. Can you confirm that this is a 1.5.8 problem only for you?