custom reporter maven surefire

2,202 views
Skip to first unread message

dst1

unread,
Apr 25, 2008, 2:45:42 AM4/25/08
to testng-users
MAybe someone can help me with this?
I´m trying to use the reportng reporter to generate a custom report
but i don´t know how to set it up.
I´m using :
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>

in my pom.xml .
Has anyone a hint how to invoke the reportng listener to generate the
report?
Do i have to add the custom listener only in my testng.xml file or do
i have to add it to the surefire plugin section in my pom.xml?

thierry.henrio

unread,
Apr 25, 2008, 9:09:45 AM4/25/08
to testng-users
mvn surefire-report:report-only should generate your report under
target/site/surefire-report.html
see documentation here http://maven.apache.org/plugins/maven-surefire-report-plugin/

you can also configure site to generate it, but i reckon tests are run
one more time ...
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
</plugins>
</reporting>

Dan Fabulich

unread,
Apr 25, 2008, 11:10:03 AM4/25/08
to testng-users
dst1 wrote:

> MAybe someone can help me with this?

> I惴 trying to use the reportng reporter to generate a custom report
> but i don愒 know how to set it up.
> I惴 using :


> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-surefire-plugin</artifactId>
> <configuration>
> <suiteXmlFiles>
> <suiteXmlFile>testng.xml</suiteXmlFile>
> </suiteXmlFiles>
> </configuration>
> </plugin>
>
> in my pom.xml .
> Has anyone a hint how to invoke the reportng listener to generate the
> report?
> Do i have to add the custom listener only in my testng.xml file or do
> i have to add it to the surefire plugin section in my pom.xml?

Adding the custom listener in your testng.xml file is a good idea. You
can also add it to your Surefire Plugin configuration; I've filed a bug to
add more documentation about this. In the meantime, here's the basic
idea:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>

<properties>
<property>
<name>listener</name>
<value>listenReport.ResultListener,listenReport.SuiteListener</value>
</property>
<property>
<name>reporter</name>
<value>listenReport.Reporter</value>
</property>
</properties>
</configuration>
</plugin>

and here's a working example:

http://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-integration-tests/src/test/resources/testng-listener-reporter

-Dan

dst1

unread,
Apr 25, 2008, 1:56:24 PM4/25/08
to testng-users
ok, thanks a lot!

Here´s what i´ve done now but maybe this is not the common way:
pom.xml
- <plugin>
<artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <suiteXmlFiles>
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
- <dependency>
<groupId>velocity</groupId>
<artifactId>velocity-dep</artifactId>
<version>1.4-rc1</version>
</dependency>
- <dependency>
<groupId>org.reportng</groupId>
<artifactId>reportng</artifactId>
<version>0.9.5</version>
<scope>test</scope>
</dependency>
- <dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.8</version>
<scope>test</scope>
<classifier>jdk15</classifier>
</dependency>

And in my testng.xml


<listeners>
<listener class-name="org.uncommons.reportng.HTMLReporter" />
<!-- <listener class-name="org.uncommons.reportng.JUnitXMLReporter" /
> -->

</listeners>

Dirk


On 25 Apr., 17:10, Dan Fabulich <d...@fabulich.com> wrote:
> dst1 wrote:
> > MAybe someone can help me with this?
> > I´m trying to use the reportng reporter to generate a custom report
> > but i don´t know how to set it up.
> > I´m using :
> http://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-integra...
>
> -Dan- Zitierten Text ausblenden -
>
> - Zitierten Text anzeigen -
Reply all
Reply to author
Forward
0 new messages