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 DependentOnMethod1AlwaysRunSampleTest {
12:
13: private boolean m_ok = false;
14:
15: /**
16: * @testng.test
17: */
18: public void a() {
19: throw new RuntimeException("Voluntary failure");
20: }
21:
22: /**
23: * @testng.test dependsOnMethods = "a" alwaysRun = "true"
24: */
25: public void b() {
26: m_ok = true;
27: }
28:
29: /**
30: * @testng.test dependsOnMethods = "b"
31: */
32: public void verify() {
33: Assert.assertTrue(m_ok, "method b() should have been invoked");
34: }
35: }
|