01: package test.alwaysrun;
02:
03: import org.testng.annotations.AfterClass;
04: import org.testng.annotations.BeforeClass;
05:
06: public class AlwaysRunAfter2 {
07:
08: private static boolean m_success = true;
09:
10: @BeforeClass
11: public void setUpShouldFail() {
12: throw new RuntimeException("Failing in setUp");
13: }
14:
15: // Should not be run
16: @AfterClass
17: public void tearDown() {
18: m_success = false;
19: }
20:
21: static public boolean success() {
22: return m_success;
23: }
24: }
|