Quantcast

equivalent of IMethodInterceptor for configuration methods?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

equivalent of IMethodInterceptor for configuration methods?

Todd Bradley-2
I created a listener class that implements IMethodInterceptor, so I can modify the list of test methods that are going to be run before any are run. It's working, but can only affect test methods. Is there an equivalent for configuration methods? I want to be able to modify that list before any tests are run.

Ultimately, what I'm trying to do is to discard test methods and configuration methods based on their test groups, at runtime. My test framework inspects the system-under-test, and makes decisions about what groups shouldn't be run. But even though my list of tests is correct (the tests that shouldn't be run are being discarded by my IMethodInterceptor), the @BeforeClass method is still being executed.


Thanks,
Todd.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: equivalent of IMethodInterceptor for configuration methods?

Julien Herr
Hi,

You can try to add a http://testng.org/javadocs/org/testng/IAnnotationTransformer2.html on your listener and disable configuration methods according to your rules.

Le vendredi 17 février 2017 16:25:49 UTC+1, Todd Bradley a écrit :
I created a listener class that implements IMethodInterceptor, so I can modify the list of test methods that are going to be run before any are run. It's working, but can only affect test methods. Is there an equivalent for configuration methods? I want to be able to modify that list before any tests are run.

Ultimately, what I'm trying to do is to discard test methods and configuration methods based on their test groups, at runtime. My test framework inspects the system-under-test, and makes decisions about what groups shouldn't be run. But even though my list of tests is correct (the tests that shouldn't be run are being discarded by my IMethodInterceptor), the @BeforeClass method is still being executed.


Thanks,
Todd.

--
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 [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Loading...