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

println("Hello World") throws Error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-1
    • 1.0-beta-6
    • None
    • None
    • Mac OS X running JDK 1.4.1 and CVS HEAD from Tue Oct 28 20:26:26 EST 2003

    Description

      The following test case:

      class SystemPrintlnTest extends GroovyTestCase {

      void testPrintHelloWorld()

      { println("Hello World") }

      }

      Fails with:

      [mccallister@kite ~/src/groovy]$maven test:single -Dtestcase=SystemPrintlnTest

      ... compilation deleted ...

      test:single:
      [junit] Running SystemPrintlnTest
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 1.617 sec
      [junit] Testsuite: SystemPrintlnTest
      [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 1.617 sec
      [junit]
      [junit] Testcase: testPrintHelloWorld took 0.064 sec
      [junit] Caused an ERROR
      [junit] failed to invoke method: public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.println(java.lang.Object) on: null with arguments: [testPrintHelloWorld(SystemPrintlnTest), 'Hello World'] reason: java.lang.IllegalArgumentException: wrong number of arguments
      [junit] org.codehaus.groovy.runtime.InvokerException: failed to invoke method: public static void org.codehaus.groovy.runtime.DefaultGroovyMethods.println(java.lang.Object) on: null with arguments: [testPrintHelloWorld(SystemPrintlnTest), 'Hello World'] reason: java.lang.IllegalArgumentException: wrong number of arguments
      [junit] at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:618)
      [junit] at groovy.lang.MetaClass.invokeMethod(MetaClass.java:217)
      [junit] at groovy.lang.MetaClass.invokeMethod(MetaClass.java:182)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [junit] at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:591)
      [junit] at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:579)
      [junit] at groovy.lang.MetaClass.invokeMethod(MetaClass.java:203)
      [junit] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:101)
      [junit] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:77)
      [junit] at SystemPrintlnTest.invokeMethod(/Users/mccallister/src/groovy/target/test-classes/groovy/SystemPrintlnTest.groovy)
      [junit] at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:87)
      [junit] at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:77)
      [junit] at SystemPrintlnTest.testPrintHelloWorld(/Users/mccallister/src/groovy/target/test-classes/groovy/SystemPrintlnTest.groovy:4)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [junit] Caused by: java.lang.IllegalArgumentException: wrong number of arguments
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      [junit] at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:591)
      [junit] ... 29 more
      [junit]
      [junit] Testcase: testPrintHelloWorld

      BUILD FAILED
      File...... file:/Users/mccallister/.maven/plugins/maven-test-plugin-1.4/
      Element... junit
      Line...... 193
      Column.... 43
      Test SystemPrintlnTest failed
      Total time: 44 seconds
      Finished at: Tue Oct 28 20:25:08 EST 2003

      [mccallister@kite ~/src/groovy]$

      Attachments

        1. println.patch
          0.8 kB
          Brian McCallister

        Activity

          People

            Unassigned Unassigned
            brianm Brian McCallister
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: