Small API adjustments

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

Small API adjustments

Serge Brisson

First, thank you for your work on maintaining and improving TestNG!

My first suggestions comes from my need to get the test name from
within an ITestListener. Since TestClass is currently the only
implementation of ITestClass, I get the test name with:

    testName = ((TestClass)

Could you make 'getTestName' method part of the ITestClass interface?
This would ensure access to the test name (in principle, ITestClass
could eventually be implemented by an other class, and even if it had
a 'getTestName' method,it would break the cast).

Also, to get to the ITestClass, this code goes thru the
ITestNGMethod.getTestClass because the ITestResult.getTestClass
returns an IClass instance. The name of the latter method seems to
suggest that it should return an ITestClass instance, shouldn't it?

My final suggestion concerns TestRunner: its static 'getVerbose'
method is used to read its static private field; however, the
'setVerbose' method which writes the same attribute is an instance
method. Since using the TestRunner constructors is not trivial, could
you make 'TestRunner.setVerbose' static?

Also, thanks for the SkipException: this is the functionality I was
asking for some times ago. At the time, I failed to make myself


You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at