Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.3
-
Fix Version/s: 1.5.5, 1.6-beta-1
-
Component/s: Ant integration
-
Labels:None
-
Environment:Mac OS X 10.5, Java 1.5
-
Number of attachments :
Description
Trying to execute a Groovy Test Case using the Groovy Ant Tasks fails because it is complaining about a missing main() method:
groovy.lang.MissingMethodException: No signature of method: org.guilder.plugin.PluginTest.main() is applicable for argument types: ([Ljava.lang.String
values: {[]}
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:54)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:59)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:169)
at org.guilder.plugin.PluginTest.invokeMethod(PluginTest.groovy)
at org.codehaus.groovy.runtime.InvokerHelper$2.run(InvokerHelper.java:426)
at org.codehaus.groovy.ant.Groovy.execGroovy(Groovy.java:348)
This happens when I use Ant through the command line as well as using AntBuilder. This is the build.xml script I use:
project>
<path id="my.classpath">
<fileset dir="/Java/groovy/lib">
<include name="*/.jar"/>
</fileset>
</path>
<target name="run">
<taskdef name="groovy"
classname="org.codehaus.groovy.ant.Groovy"
classpathref="my.classpath"/>
<groovy src="org/guilder/plugin/PluginTest.groovy">
</groovy>
</target>
</project>
Executing the Script through: 'groovy org/guilder/plugin/PluginTest.groovy' it works fine.
Unfortunately I could not figure out how the Groovy Command Line tool does handle that otherwise I would created a patch.
Any ideas?
-Andy
Attachments
Issue Links
| This issue is duplicated by: | ||||
| GROOVY-2590 | MissingMethodException in Unit Test |
|
|
|
And by the way I ran into another issue with the Groovy jUnit Tests. Using the GroovyTestCase does fail on me because it cannot find the jUnit Test Case class. This is an issue for me because I fire up groovy without jUnit in its class path and then add it dynamically at runtime. Unfortunately the GroovyTestCase is attached to the class loader that stated Groovy and so I cannot add the jUnit archive on the same class loader level. Thus I get a No Class Def Found Error.
-Andy