Details
Description
Running the classes shown below results in:
groovy -cp ..\main\groovy ..\main\groovy\MainInvokeSub.groovy
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.
However, if the 'extends MainInvokeBase' is removed or if the second class is commented out, it does run.
The only "spec" I could find about the expected behavior is in the GINA book.
file: MainInvokeBase.groovy
class MainInvokeBase {
}
file: MainInvokeSub.groovy
class MainInvokeSub extends MainInvokeBase{
static main(args)
}
def class SecondClass{
}
Activity
blackdrag blackdrag
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | 1.5.8 [ 14630 ] | |
| Fix Version/s | 1.7-beta-1 [ 14014 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.2 [ 15151 ] | |
| Fix Version/s | 1.5.8 [ 14630 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.2 [ 15151 ] | |
| Fix Version/s | 1.6.3 [ 15251 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.6.3 [ 15251 ] |
Guillaume Laforge
made changes -
| Fix Version/s | 1.7-beta-1 [ 14014 ] | |
| Fix Version/s | 1.7-beta-x [ 15538 ] |
blackdrag blackdrag
made changes -
| Fix Version/s | 1.8.x [ 15750 ] | |
| Fix Version/s | 2.x [ 17013 ] | |
| Fix Version/s | 1.7.x [ 15538 ] |
and switching the order of the classes in MainInvokeSub does not help?