JUnit Post-Processor
The JUnit post-processor can be used to process XML reports in the format produced by the junitreport
task of the Apache Ant
build tool. Both combined reports and individual reports (i.e. the reports generated by each test class) are supported. Test suite and case results from the report will be added to the test results for the build.
Attributes
| Attribute |
Description |
Required? |
Default |
| case-element |
The name of the XML element for test cases. |
No |
testcase |
| fail-on-failure |
If true, the build will be failed if any test failures are detected by this processor. |
No |
true |
| name |
The name of the post-processor. |
Yes |
|
| suite-element |
The name of the XML element for test suites. |
No |
testsuite |
| suite |
If a suite is specified, all tests found by this processor will be added to that suite. |
No |
|
Child Elements
None.
Examples
Create and apply a JUnit post-processor to a captured test report:
<junit.pp name="junit"/>
<recipe name="default">
<command name="build">
<ant targets="build.all"/>
<artifact name="junit xml report" file="build/reports/junit/TESTS-TestSuites.xml" fail-if-not-present="false">
<process processor="${junit}"/>
</artifact>
</command>
</recipe>
Capture a directory of individual reports and process them all:
<junit.pp name="junit"/>
<recipe name="default">
<command name="build">
<ant targets="build.all"/>
<dir-artifact name="test reports" base="${base.dir}/reports" fail-if-not-present="false">
<include pattern="**/TEST-*.xml"/>
<process processor="${junit}"/>
</dir-artifact>
</command>
</recipe>
A post-processor for JUnit-like reports with different XML element names:
<junit.pp name="myunit" suite-element="mysuite" case-element="mycase"/>