How can I run ‘mvn’.
I’m using Netbeans 7 and when I run my Unit tests, I do get generated XML files from my project /target folder
/target/surefire-reports/TEST-package.name.ClassNameTest.xml
/target/surefire-reports/TEST-package.name.ClassNameTest.txt
But from all the xml and txt files from my test packages,
I can’t figure out how to generate a HTML Report.
I’m currently using a Maven Netbeans Project. Here is my pom.xml file:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.11.0</version>
</dependency>
</dependencies>
<groupId>com.honeycomb</groupId>
<artifactId>com.honeycomb</artifactId>
<!-- To use the report goals in your POM or parent POM -->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.10</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
</plugins>
</reporting>
I can get my tests to pass fine, I use the built in Unit Runner with Junit4 in Netbeans.
I have googled all over the place, all I find is poorly documented examples and not a complete walkthrough on how to generate a report HTML file with my test outcomes.
Not sure if this is relevant but Im developing under Windows XP. JDK 7. The Maven I use is straight out of the Netbeans Project.
I have seen posts and examples through using:
http://maven.apache.org/maven-1.x/plugins/junit-report/goals.html
junit-report:report and junit-report but I can’t seem to figure out any of this stuff.
Just looking for a simple generated HTML file.
If you run the command
mvn surefire-report:report, then you should find a file calledtarget/site/surefire-report.htmlgets generated after surefire runs your tests again.If you’re just running from the command-line, then I think this will get you what you want. If you’re using a CI server like Jenkins or Hudson, then I would suggest looking into the Sonar server and its reports.