If you have tests written with TestNG, you can easily annotate your tests to run with one of the listeners from tap4j, or specify a listener in your project pom.
The TAP TestNG listeners are organized under the org.tap4j.ext.testng.listener package.
Listener | Feature |
---|---|
TapListenerClass | Outputs TAP per class |
TapListenerClassYaml | Outputs TAP per class with YAML |
TapListenerMethod | Outputs TAP per method |
TapListenerMethodYaml | Outputs TAP per method with YAML |
TapListenerSuite | Outputs TAP per suite |
TapListenerSuiteYaml | Outputs TAP per suite with YAML |
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.12.4</version> <configuration> <properties> <property> <name>listener</name> <value>org.tap4j.ext.testng.listener.TapListenerMethod</value> </property> </properties> </configuration> </plugin> </plugins> </build>
Add the following to your TestNG suite xml file in order to produce TAP Streams within your TestNG tests. Do not forget to add tap4j jar into your classpath during execution of the tests.
<suite> <listeners> <listener class-name="org.tap4j.ext.testng.listener.TapListenerSuite" /> </listeners> ...