[testng-dev] Invoking org.testng.ISuite.addListener(ITestNGListener listener) doesn't do anything in a configuration method (@BeforeSuite)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[testng-dev] Invoking org.testng.ISuite.addListener(ITestNGListener listener) doesn't do anything in a configuration method (@BeforeSuite)

Javier Velasquez
Hi,

I was exploring the API and ran across addListener and thought that I could programmatically add my listener. This functionality would save me from having to declare my custom listeners in my POM or in my Test Suite XML. It looks like that this method is used by SuiteRunner to initialize listeners in the initial TestNG setup. Meaning I shouldn't be able to invoke it, for example, in a BeforeSuite method. Is this expected behavior? I am afraid the answer is yes. So my follow up question is: it is possible to add listeners programmatically without a programmatic invocation of TestNG through the TestNG class?

--
Javier

--
You received this message because you are subscribed to the Google Groups "testng-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at http://groups.google.com/group/testng-dev.
For more options, visit https://groups.google.com/d/optout.