groovy

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

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0-JSR-3
  • Fix Version/s: 1.1-rc-2
  • Component/s: Ant integration
  • Labels:
    None
  • Environment:
    All
  • Number of attachments :
    0

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}")
			}
		}
	}
}

Activity

Hide
Paul King added a comment -

Added wiki code tags to the issue description

Show
Paul King added a comment - Added wiki code tags to the issue description
Hide
Paul King added a comment -

I would like to close this issue. I have just tried this with the latest version of Groovy and it seems to work fine.

Show
Paul King added a comment - I would like to close this issue. I have just tried this with the latest version of Groovy and it seems to work fine.
Hide
Paul King added a comment -

No further feedback, assuming fixed.

Show
Paul King added a comment - No further feedback, assuming fixed.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: