Understanding PDF translation
The ant target junitreport aggregates testresults in a summary xml document, typically named TESTS-TestSuites.xml.
JUnit PDF Report converts the summary file to an XSL-FO xml document.
That document is handed over to FOP for PDF rendering.
junitreport aggregated results layout
This section explains the layout of the summary file created by ant's junitreport target.
<testsuites> 1 the aggregated result of all junit testfiles |
Considerations:
A package can appear in multiple testsuite instances.
To correctly calculate package statistics, data from all instances for that package has to be summarized.
conversion to XSL-FO
This section explains how the junitreport summary file is processed
Summary section
The summary section of the PDF report aggregates:
- the total number of tests
- the total number of errors
- the total number of failures
- the total execution time
It also derives the success rate using the formula: (tests - errors - failures) / tests.
xpath: /testsuites
calculations:
|
Packages section
This section is divided in two parts:
- part 1: all packages covered in the unit tests, and their statistics
- part 2: per package, all testsuites and their statistics
Part 1 of the packages section of the PDF report aggregates:
- the total number of tests per package
- the total number of errors per package
- the total number of failures per package
- the total execution time per package
Part 2 of the packages section of the PDF report displays, grouped by package:
- the total number of tests per testsuite
- the total number of errors per testsuite
- the total number of failures per testsuite
- the total execution time per testsuite
xpath: /testsuites/testsuite[not(./@package = preceding-sibling::testsuite/@package)]
sort: @package
The not qualifier skips a package if it has already been visited in a previous testsuite (see Considerations).
calculations:
Part 1:
|
Part 2:
|
Testcases section
This section shows each testsuite in detail:
- the testcases covered in the testsuite
- the status of each testcase
- the error message in case of failure or error
- statistics
System.outandSystem.errlog, if available
xpath: testsuite
sort: @name
calculations:
|
<xsl:when test="error"><xsl:text>Error</xsl:text></xsl:when> system-out |



