Dashboard > Pulse v1.2 > ... > pulse Files > junit.pp
  Pulse v1.2 Log In | Sign Up   View a printable version of the current page.  
  junit.pp
Added by Jason Sankey, last edited by Daniel Ostermeier on May 15, 2007  (view change)
Labels: 
(None)

Pulse Manual Index

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.

Other Testing Libraries

This post-processor is not restricted to projects that use JUnit. Various other testing libraries (such as PyUnit and TestNG) are also able to produce reports in this format, sometimes by using an extension. For other libraries, it is usually not difficult to produce reports in a compatible format.

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"/>

Zutubi wiki is Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators