Dear All,

I'm trying to configure gradle with TestNG support and having
problems. For some reason gradle tries to delete my suite
configuration file (testng.xml) from testResultsDir.  The file exists
only in testSrcDirs.

Here is my configuration :
task test(overwrite:true, dependsOn:'compileTests', type:Test) {
   useTestNG()
   disableTestReport()

   options.suites("${testSrcDirNames[0]}/testng.xml")
}


And here is the error message:
Cause: Failed to delete TestNG suite XML file
${buildDir}/test-results/testng.xml

BUILD FAILED


I've looked into TestNGOptions.groovy and indeed it tries to delete
all suite files:

        // Suites need to be in one directory because the suites can
only be passed to the testng ant task as an ant fileset.
   suiteXmlFiles.each { File it ->
            final File targetSuiteFile = new File(testSuitesDir, it.getName())

            if ( !targetSuiteFile.delete() ) {  <--      ???
                throw new GradleException("Failed to delete TestNG
suite XML file " + targetSuiteFile.absolutePath);
            }

            GFileUtils.copyFile(it, targetSuiteFile)

            suites.add(targetSuiteFile)
        }

So I was wondering if file existence should be checked first or it is
normal behavior  ?

Thanks for your help.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to