[testng-dev] Is @Test annotation on class compatible with IHookable?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[testng-dev] Is @Test annotation on class compatible with IHookable?

Tim Boemker
The TestNG documentation says this:

The @Test annotation can be put on a class instead of a test method.  The effect of a class level @Test annotation is to make all the public methods of this class to become test methods even if they are not annotated.

Is it possible for a class with an @Test annotation to implement IHookable?  Because run(IHookCallBack callBack, ITestResult testResult) is public, TestNG tries unsuccessfully to run it as a test method.

Is there a way to tell TestNG to ignore this method?

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: [testng-dev] Is @Test annotation on class compatible with IHookable?

Cédric Beust ♔-2
Not really. The usual way to do this is to make the method protected but it's not an option here since you are implementing an interface. Either put it in a different class or maybe an inner class? (although it might still be captured by the class-level @Test annotation, not 100% sure).

-- 
Cédric


-- 
Cédric



On Fri, Mar 1, 2013 at 12:10 PM, Tim Boemker <[hidden email]> wrote:
The TestNG documentation says this:

The @Test annotation can be put on a class instead of a test method.  The effect of a class level @Test annotation is to make all the public methods of this class to become test methods even if they are not annotated.

Is it possible for a class with an @Test annotation to implement IHookable?  Because run(IHookCallBack callBack, ITestResult testResult) is public, TestNG tries unsuccessfully to run it as a test method.

Is there a way to tell TestNG to ignore this method?

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: [testng-dev] Is @Test annotation on class compatible with IHookable?

Tim Boemker
I don't see how it can be put in a different class, or an inner class.  To be useful, it has to be implemented in the test class:

If a test class implements this interface, its run() method will be invoked instead of each @Test method found.

On Friday, March 1, 2013 12:45:12 PM UTC-8, Cédric Beust ♔ wrote:
Not really. The usual way to do this is to make the method protected but it's not an option here since you are implementing an interface. Either put it in a different class or maybe an inner class? (although it might still be captured by the class-level @Test annotation, not 100% sure).

-- 
Cédric


-- 
Cédric



On Fri, Mar 1, 2013 at 12:10 PM, Tim Boemker <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="iUq5zbxW7SsJ">t...@...> wrote:
The TestNG documentation says this:

The @Test annotation can be put on a class instead of a test method.  The effect of a class level @Test annotation is to make all the public methods of this class to become test methods even if they are not annotated.

Is it possible for a class with an @Test annotation to implement IHookable?  Because run(IHookCallBack callBack, ITestResult testResult) is public, TestNG tries unsuccessfully to run it as a test method.

Is there a way to tell TestNG to ignore this method?

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="iUq5zbxW7SsJ">testng-dev+...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="iUq5zbxW7SsJ">testn...@....
Visit this group at http://groups.google.com/group/testng-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.