01: package test.alwaysrun;
02:
03: public class ClassWithAlwaysAfterClassMethod {
04:
05: /**
06: * @testng.before-class
07: */
08: public void beforeTestMethod() {
09: AlwaysRunTest.LOG.append("-before");
10: }
11:
12: /**
13: * @testng.test
14: */
15: public void nonFailingTest() {
16: AlwaysRunTest.LOG.append("-nonfail");
17: }
18:
19: /**
20: * @testng.test dependsOnMethods="nonFailingTest"
21: */
22: public void failingTest() {
23: AlwaysRunTest.LOG.append("-fail");
24: throw new RuntimeException();
25: }
26:
27: /**
28: * @testng.after-class alwaysRun="true"
29: */
30: public void afterTestMethod() {
31: AlwaysRunTest.LOG.append("-after");
32: }
33:
34: }
|