Issue Details (XML | Word | Printable)

Key: TESTNG-468
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Cedric Beust
Reporter: Michael Benz
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
TestNG

Listeners defined in suite XML file are ignored

Created: 04/Feb/11 05:56 AM   Updated: 07/Feb/11 03:03 AM
Component/s: Core
Affects Version/s: 5.14.6
Fix Version/s: None


 Description  « Hide
Listeners defined in a suite XML file (listeners/listener tag) are ignored on execution (invocation via command line).

There were some changes to the TestNG class regarding listeners in 5.14.6.

I tried to analyze the problem for a bit and here's what I could figure out:
It seems that the 'initializeConfiguration' method is only invoked once before the xml suites (m_suites field) are initialized.
The m_suites will be initialized later via 'initializeSuitesAndJarFiles'.

The listeners are created in the 'initializeConfiguration' method, so it should be invoked after init of the xml suites?

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Cedric Beust added a comment - 04/Feb/11 01:21 PM
Thanks for looking into it, Michael, you are absolutely right.

I just fixed this, added a test and pushed a new version (5.14.9), which should be available in Maven central soon (update: maybe not, there is a problem with the upload site right now).

Can you check the fix and report back? You can do this either by downloading 5.14.9 from testng.org or by pulling from github.

Thanks!

Michael Benz added a comment - 07/Feb/11 03:03 AM
Tested it with 5.14.9 from the central maven repo.

The listeners are now initialized properly.

Thanks for the quick help!