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

Groovy Ant Task is not executing Groovy Test Cases as the Command Line does

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.5.3
    • 1.5.5, 1.6-beta-1
    • Ant integration
    • None
    • Mac OS X 10.5, Java 1.5

    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

        1. build.xml
          1 kB
          James P. White

        Issue Links

          Activity

            People

              paulk Paul King
              schaefera Andreas Schaefer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: