01: package test.dependent;
02:
03: import org.testng.Assert;
04:
05: /**
06: * a will fail but b should run anyway because of alwaysRun=true
07: *
08: * Created on Nov 18, 2005
09: * @author cbeust
10: */
11: public class DependentOnGroup2AlwaysRunSampleTest {
12:
13: private boolean m_ok = false;
14:
15: /**
16: * @testng.test groups = "group-a"
17: */
18: public void a() {
19: throw new RuntimeException("Voluntary failure");
20: }
21:
22: /**
23: * @testng.test groups = "group-a"
24: */
25: public void a2() {
26: }
27:
28: /**
29: * @testng.test dependsOnGroups = "group-a" alwaysRun = "true"
30: */
31: public void b() {
32: m_ok = true;
33: }
34:
35: /**
36: * @testng.test dependsOnMethods = "b"
37: */
38: public void verify() {
39: Assert.assertTrue(m_ok, "method b() should have been invoked");
40: }
41: }
|