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

Task.execute() not called when expected within a sequential closure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-3
    • 1.1-rc-2
    • Ant integration
    • None
    • All

    Description

      If using the AntBuilder and the sequential task, the Task.execute() does
      not seem to be called when expected.

      For instance in the example below, the mkdir.execute() is not called
      before the fileset is processed in the junitreport task. So, you get
      an error message saying the fileset dir is not there. But, if the mkdir
      was created when expected, it would be there.

      This did work as expected in earlier versions of Groovy (sometime before jsr-03).
      I tested it with a cvs snapshot I had done yesterday, and this behavior is in it.

      class ATest extends GroovyTestCase {
       
      	def reportXmlDir = "/temp/reports/xml"
      	def reportHtmlDir = new File("/temp/reports/html")
       
      	void testSomething() {
      		def ant = new AntBuilder()
       
      		//uncomment the following two lines to fix it
      		//ant.mkdir(dir:reportXmlDir)
      		//ant.mkdir(dir:reportHtmlDir)
       
      		ant.sequential() {
       
      			//these mkdirs are NOT done before the next fileset is processed!
      			//It seems the mkdir.execute method should be called before the
      			//fileset is processed
      			mkdir(dir:reportXmlDir)
      			mkdir(dir:reportHtmlDir)
       
      			//junit task snipped (same error occurs with or without it)
       
      			//Merge xml files and create report
      			junitreport(toDir:"${reportHtmlDir}") {
      				fileset(dir:"${reportXmlDir}") {
      					include(name:"TEST-*.xml")
      				}
      				report(format:"frames", todir:"${reportHtmlDir}")
      			}
      		}
      	}
      }
      

      Attachments

        Activity

          People

            paulk Paul King
            lewijw John Lewis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: