[infinispan-dev] usage of alwaysRun=true on @BeforeMethod and alike

Mircea Markus mmarkus at redhat.com
Thu May 9 16:15:56 EDT 2013


On 9 May 2013, at 17:33, Dan Berindei wrote:

> A test method is "skipped" only if a dependency of the test failed (e.g. a @BeforeMethod method). A test that's in a different group may be considered "ignored" or "disabled", but it's not "skipped". Since TestNG is not even trying to run the method, it shouldn't run any @BeforeMethod/@AfterMethod methods for it either.
That's what it actually does by default, but alwaysRun overrides that behaviour (at least in @BeforeXYZ): http://testng.org/javadoc/org/testng/annotations/BeforeMethod.html#alwaysRun()
>From what I saw it's the same for @AfterXYZ.
> 
> I wrote a test class with different groups for the test method and each confguration method, and the only configuration methods that ran even with no test method in the default group were @BeforeTest/@AfterTest.

Good to know. 

Cheers,
-- 
Mircea Markus
Infinispan lead (www.infinispan.org)







More information about the infinispan-dev mailing list