scan.setIncludes( new String[] { "*.swf" } );
scan.addDefaultExcludes();
scan.setBasedir( testOutputDirectory );
scan.scan();
CoverageReporter reporter = null;
if ( coverage )
{
try
{
reporter = coverageReporterManager.getReporter( coverageProvider );
reporter.setExcludes( coverageExclusions );
}
catch ( CoverageReportException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
}
try
{
String[] swfs = scan.getIncludedFiles();
runTests( swfs, reporter );
}
finally
{
if ( coverage )
{
CoverageReportRequest request =
new CoverageReportRequest( coverageDataDirectory, coverageReportFormat, coverageReportEncoding,
coverageOutputDirectory,
new File( project.getBuild().getSourceDirectory() ) );
try
{
reporter.generateReport( request );
File index = new File(coverageOutputDirectory.getAbsolutePath() + "/index.html");
if(index.exists())
FileUtils.copyFile(index, new File(coverageOutputDirectory.getAbsolutePath() + "/index.bak.html"));
}
catch ( CoverageReportException e )