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#always...
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)