Gradle

TestNG - listeners problem (no report generated)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.9
  • Fix Version/s: 0.9-rc-1
  • Component/s: testing
  • Labels:
    None
  • Environment:
    Gradle 0.9-20100302224259+0100

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)

Activity

Hide
Adam Murdoch added a comment -

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().

Show
Adam Murdoch added a comment - 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().
Hide
Daniel Dyer added a comment -

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.

Show
Daniel Dyer added a comment - 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.
Hide
Daniel Dyer added a comment -

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).

Show
Daniel Dyer added a comment - 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).
Hide
Hans Dockter added a comment -

Excellent. Thanks a lot.

Show
Hans Dockter added a comment - Excellent. Thanks a lot.
Hide
Tomek Kaczanowski added a comment -

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.

Show
Tomek Kaczanowski added a comment - 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.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: