O'Reilly logo

Mastering Software Testing with JUnit 5 by Boni García

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Maven Surefire Report

By default, maven-surefire-plugin generates the XML resulting from a test suite execution as ${basedir}/target/surefire-reports/TEST-*.xml. This XML output can be easily parsed to HTML using the plugin maven-surefire-report-plugin. To that, we simply need to declare this plugin in the reporting clause of our pom.xml, as follows:

<reporting>    <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-surefire-report-plugin</artifactId>            <version>${maven-surefire-report-plugin.version}</version>        </plugin>    </plugins></reporting>

This way, when we invoque the Maven lifecycle for documentation (mvn site), an HTML page with the test result will be included in the general report.

See an example of the report, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required