[GRADLE-836] TestNG - listeners problem (no report generated) Created: 02/Mar/10  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: 0.9
Fix Version/s: 0.9-rc-1

Type: Bug
Reporter: Tomek Kaczanowski Assignee: Hans Dockter
Resolution: Fixed Votes: 0

Attachments: Zip Archive testng_listeners.zip    

 Description   

no report is generated by TestNG listeners (other than default listeners)

test {
useTestNG()
options.listeners << 'org.uncommons.reportng.HTMLReporter'
options.listeners << 'org.uncommons.reportng.JUnitXMLReporter'
//useDefaultListeners = false
}

see attached project

it used to work with 0.8 (but with slightly different syntax)



 Comments   
Comment by Adam Murdoch [ 03/Mar/10 ]

Reportng is using the system ClassLoader to locate its reporting resources (AbstractReporter.java line 122). This won't work if Reportng is not loaded by the system ClassLoader.

Gradle no longer loads classes under test using the system ClassLoader, and so Reportng is failing.

Reportng should use whichever ClassLoader it has been loaded with to locate its resources, such as, for example, using getClass().getClassLoader() or even Thread.currentThread().getContextClassLoader().

Comment by Daniel Dyer [ 09/Mar/10 ]

I'm the author of ReportNG. Somebody pointed me to this issue. I'll take a look at it shortly. Assuming the change doesn't cause any other problems it will be in the upcoming 1.1 release.

Comment by Daniel Dyer [ 09/Mar/10 ]

By "somebody" I of course meant Tomek, reporter of the issue. Sorry, the Java.net mailing lists baffle me sometimes. I've committed a fix to ReportNG's Subversion. So if you need it right away, you can check it out and build from source. Version 1.1 will be released soon (current best guess about a week, but that's subject to change).

Comment by Hans Dockter [ 10/Mar/10 ]

Excellent. Thanks a lot.

Comment by Tomek Kaczanowski [ 12/Jul/10 ]

This works now with ReportNG 1.1.1

Cookbook updated: http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-addreporters

The issue can be closed as fixed.

Generated at Wed Jun 30 11:40:11 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.