Re: Is there a way to get IConfiguration object in ITestRunnerFactory which can be passed to a custom TestRunner in TestNG 6.8?

124 views
Skip to first unread message

Francisco González

unread,
Feb 17, 2014, 3:26:08 AM2/17/14
to testng...@googlegroups.com

I've got exactly the same problem. Did you resolve it yet?

Thank you.

El jueves, 30 de mayo de 2013 00:01:51 UTC+2, Tim Kuo escribió:

I am implementing the ITestRunnerFactory interface in TestNG 6.8 whose newTestRunner method returns me a TestRunner , I want to have specific test runners so am extending TestRunner class . Now the constructor of TestRunner class demands IConfiguration object passed to it . Is there a way to get the IConfiguration object in my implementation of ITestRunnerFactory so that i can pass it to constructor of my Custom TestRunner ? .

Most of the examples that i saw o the net are prior to TestNG 6.8 ( mostly 5.x) , where the signature of TestRunner constructor wasn't having the IConfiguration object .Hence any links illustrating the usage would also prove helpful .

Krishnan Mahadevan

unread,
Feb 18, 2014, 2:46:11 AM2/18/14
to testng...@googlegroups.com
why not pass an instance of org.testng.internal.Configuration [ This public class implements the IConfiguration interface].

Even TestNG merely instantiates this class

m_configuration = new Configuration();


and then later packs in the required values via the setters.

    m_configuration.setAnnotationFinder(new JDK15AnnotationFinder(getAnnotationTransformer()));

    m_configuration.setHookable(m_hookable);

    m_configuration.setConfigurable(m_configurable);

    m_configuration.setObjectFactory(factory);

Would that help ?



Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/


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

Samuel Yang

unread,
Jul 27, 2017, 2:51:56 PM7/27/17
to testng-users
Have you resolved this issue, I am hitting it

Krishnan Mahadevan

unread,
Jul 27, 2017, 11:01:47 PM7/27/17
to testng...@googlegroups.com

Samuel,

 

Did you try my suggestion in this thread ? You can instantiate a org.testng.internal.Configuration#Configuration() via its default constructor and then pass it on to the TestRunner. That should suffice.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

--

You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages