01: package test.groupinvocation;
02:
03: import org.testng.Assert;
04: import org.testng.annotations.AfterClass;
05: import org.testng.annotations.Test;
06:
07: /**
08: * This class/interface
09: */
10: public class DummyTest2 {
11: private boolean m_invoked = false;
12:
13: @Test(groups={"A"})
14: public void dummyTest() {
15: m_invoked = true;
16: }
17:
18: @AfterClass(alwaysRun=true)
19: public void checkInvocations() {
20: Assert.assertFalse(m_invoked,
21: "@Test method invoked even if @BeforeGroups failed");
22: }
23: }
|