{
DecimalFormatSymbols symbols = new DecimalFormatSymbols( locale );
percentFormat = new DecimalFormat( getText( locale, "report.invoker.format.percent" ), symbols );
secondsFormat = new DecimalFormat( getText( locale, "report.invoker.format.seconds" ), symbols );
Sink sink = getSink();
sink.head();
sink.title();
sink.text( getText( locale, "report.invoker.result.title" ) );
sink.title_();
sink.head_();
sink.body();
sink.section1();
sink.sectionTitle1();
sink.text( getText( locale, "report.invoker.result.title" ) );
sink.sectionTitle1_();
sink.paragraph();
sink.text( getText( locale, "report.invoker.result.description" ) );
sink.paragraph_();
sink.section1_();
// ----------------------------------
// build buildJob beans
// ----------------------------------
File[] reportFiles = ReportUtils.getReportFiles( reportsDirectory );
if ( reportFiles.length <= 0 )
{
getLog().info( "no invoker report files found, skip report generation" );
return;
}
List<BuildJob> buildJobs = new ArrayList<BuildJob>( reportFiles.length );
for ( File reportFile : reportFiles )
{
try
{
BuildJobXpp3Reader reader = new BuildJobXpp3Reader();
buildJobs.add( reader.read( ReaderFactory.newXmlReader( reportFile ) ) );
}
catch ( XmlPullParserException e )
{
throw new MavenReportException( "Failed to parse report file: " + reportFile, e );
}
catch ( IOException e )
{
throw new MavenReportException( "Failed to read report file: " + reportFile, e );
}
}
// ----------------------------------
// summary
// ----------------------------------
constructSummarySection( buildJobs, locale );
// ----------------------------------
// per file/it detail
// ----------------------------------
sink.section2();
sink.sectionTitle2();
sink.text( getText( locale, "report.invoker.detail.title" ) );
sink.sectionTitle2_();
sink.section2_();
// detail tests table header
sink.table();
sink.tableRow();
// -------------------------------------------
// name | Result | time | message
// -------------------------------------------
sinkTableHeader( sink, getText( locale, "report.invoker.detail.name" ) );
sinkTableHeader( sink, getText( locale, "report.invoker.detail.result" ) );
sinkTableHeader( sink, getText( locale, "report.invoker.detail.time" ) );
sinkTableHeader( sink, getText( locale, "report.invoker.detail.message" ) );
sink.tableRow_();
for ( BuildJob buildJob : buildJobs )
{
renderBuildJob( buildJob, locale );
}
sink.table_();
sink.body_();
sink.flush();
sink.close();
}