Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.4, 1.8-beta-1
-
Fix Version/s: 1.7.4, 1.8-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Test.groovy
class B extends A { static main(args){} } class A {}
fails with
Caught: groovy.lang.GroovyRuntimeException: This script or class could not be run. It should either: - have a main method, - be a JUnit test, TestNG test or extend GroovyTestCase, - or implement the Runnable interface.
Issue Links
- is related to
-
GROOVY-1328
cleanup strategy of choosing the class to execute when a file contains multiple classes
-
ModuleNode#sortClasses() seems to be sorting classes in order of inheritance and that's why orders A ahead of B.
In an example like the one given here, it looks wrong to me.
In class sorting, should it take into account, which class is the executable one (as per the criteria used in GroovyShell#runScriptOrMainOrTestOrRunnable())?