Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-488

TestNGOptions propertyMissing and methodMissing returns null if suiteXmlBuilder is null.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.6

      Description

      public def propertyMissing(String name) {
              if ( suiteXmlBuilder != null ) {
                  return suiteXmlBuilder.getMetaClass()."${name}"
              }
              else {
                  super.propertyMissing(name)
              }
          }
      
          public def methodMissing(String name, args) {
              if ( suiteXmlBuilder != null ) {
                  return suiteXmlBuilder.getMetaClass().invokeMethod(suiteXmlBuilder, name, args);
              }
              else {
                  super.methodMissing(name, args)
              }
          }
      

      The else value won't be used by Groovy as the return value. Thus the methods returns null in the else case. In Groovy 1.6 this behavior has changed (but we are still with 1.5.6). The code fix is obvious but we should also have a unit test checking this.

        Attachments

          Activity

            People

            Assignee:
            teyckmans Tom Eyckmans
            Reporter:
            hans_d Hans Dockter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: