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

Mircea Markus mmarkus at redhat.com
Wed May 8 11:36:24 EDT 2013


This makes the invocation of that method happen even if the test is not in the running group:http://testng.org/javadoc/org/testng/annotations/BeforeMethod.html#alwaysRun()

E.g. if I want to run the "xsite" groups, all the @AfterMethod(alwaysRun=true) from the "functional" groups are also invoked, most likely causing NPEs as the resources from this tests haven't been initialised. So unless used for an abstract test class that would be extended by multiple classes from different groups, I don't see any point in using "alwaysRun" on neither @BeforeMethod nor on @AfterMethod.


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







More information about the infinispan-dev mailing list