junitreport

JUnit report for TestNG executions

License

License

Categories

Categories

JUnit Unit Testing
GroupId

GroupId

com.rationaleemotions
ArtifactId

ArtifactId

junitreport
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

junitreport
JUnit report for TestNG executions
Project URL

Project URL

http://maven.apache.org
Source Code Management

Source Code Management

https://github.com/RationaleEmotions/junitreport

Download junitreport

How to add to project

<!-- https://jarcasting.com/artifacts/com.rationaleemotions/junitreport/ -->
<dependency>
    <groupId>com.rationaleemotions</groupId>
    <artifactId>junitreport</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.rationaleemotions/junitreport/
implementation 'com.rationaleemotions:junitreport:1.0.0'
// https://jarcasting.com/artifacts/com.rationaleemotions/junitreport/
implementation ("com.rationaleemotions:junitreport:1.0.0")
'com.rationaleemotions:junitreport:jar:1.0.0'
<dependency org="com.rationaleemotions" name="junitreport" rev="1.0.0">
  <artifact name="junitreport" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.rationaleemotions', module='junitreport', version='1.0.0')
)
libraryDependencies += "com.rationaleemotions" % "junitreport" % "1.0.0"
[com.rationaleemotions/junitreport "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.testng : testng jar 6.11

Project Modules

There are no modules declared in this project.

JUnit Report

This is a reporter for TestNG which generates the reports in xml format adhering to the JUnit test result schema for the Apache Ant JUnit and JUnitReport tasks.

The schema being used is referred from the GitHub repository: JUnit-Schema.

To get started, just add the following as a maven dependency:

<dependency>
    <groupId>com.rationaleemotions</groupId>
    <artifactId>junitreport</artifactId>
    <version>1.0.0</version>
</dependency>

Merely adding this artifact as a dependency should suffice. Service loader mechanism is used to wire in this listener. So there is no need to explicitly add the listener via the <listener> tag (or) via the @Listeners annotation.

Here's a sample of how a generated report can look like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testsuite name="SecondTest" timestamp="2017-07-29T20:16:12.846+05:30" hostname="necropolis.local" tests="4"
           failures="1" errors="2">
    <properties>
        <property name="errors" value="2"/>
        <property name="failures" value="1"/>
        <property name="ignored" value="0"/>
    </properties>
    <testcase name="@BeforeClass beforeClass" classname="com.rationaleemotions.AnotherApp" time="1"/>
    <testcase name="passTestMethod" classname="com.rationaleemotions.AnotherApp" time="5001"/>
    <testcase name="failTestMethod" classname="com.rationaleemotions.AnotherApp" time="2">
        <failure message="Simulating a failure" type="java.lang.AssertionError"/>
    </testcase>
    <testcase name="errorTestMethod" classname="com.rationaleemotions.AnotherApp" time="1">
        <error message="ERRORED due to : Simulating a failure" type="java.lang.RuntimeException">
            java.lang.RuntimeException: Simulating a failure
            at com.rationaleemotions.AnotherApp.errorTestMethod(AnotherApp.java:31)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
            at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
            at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
            at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
            at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
            at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
            at org.testng.TestRunner.privateRun(TestRunner.java:744)
            at org.testng.TestRunner.run(TestRunner.java:602)
            at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
            at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
            at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
            at org.testng.SuiteRunner.run(SuiteRunner.java:289)
            at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
            at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
            at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
            at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
            at org.testng.TestNG.runSuites(TestNG.java:1144)
            at org.testng.TestNG.run(TestNG.java:1115)
            at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
            at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
        </error>
    </testcase>
    <testcase name="skipTestMethod" classname="com.rationaleemotions.AnotherApp" time="0">
        <error message="SKIPPED due to : Method AnotherApp.skipTestMethod()[pri:0, instance:com.rationaleemotions.AnotherApp@483bf400] depends on not successfully finished methods"
               type="java.lang.Throwable">java.lang.Throwable: Method AnotherApp.skipTestMethod()[pri:0,
            instance:com.rationaleemotions.AnotherApp@483bf400] depends on not successfully finished methods
            at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1084)
            at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
            at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
            at org.testng.TestRunner.privateRun(TestRunner.java:744)
            at org.testng.TestRunner.run(TestRunner.java:602)
            at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
            at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
            at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
            at org.testng.SuiteRunner.run(SuiteRunner.java:289)
            at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
            at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
            at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
            at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
            at org.testng.TestNG.runSuites(TestNG.java:1144)
            at org.testng.TestNG.run(TestNG.java:1115)
            at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
            at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)
        </error>
    </testcase>
    <system-out>Test message from beforeClass()
        Test message from testMethod()
    </system-out>
</testsuite>
com.rationaleemotions

Rationale Emotions

This organization houses all the projects that are being built by @krmahadevan

Versions

Version
1.0.0