01: package test.conffailure;
02:
03: import org.testng.annotations.AfterClass;
04: import org.testng.annotations.BeforeClass;
05: import org.testng.annotations.Test;
06:
07: public class ClassWithFailedBeforeTestClassVerification {
08:
09: private static boolean m_success1 = false;
10: private static boolean m_success2 = false;
11:
12: // Should be run even though ClassWithFailedBeforeTestClass failed in its configuration
13: @BeforeClass
14: public void setUpShouldPass() {
15: m_success1 = true;
16: }
17:
18: // Should be run even though ClassWithFailedBeforeTestClass failed in its configuration
19: @AfterClass
20: public void tearDown() {
21: m_success2 = true;
22: }
23:
24: // Adding this method or @Configuration will never be invoked
25: @Test
26: public void dummy() {
27:
28: }
29:
30: static public boolean success() {
31: return m_success1 && m_success2;
32: }
33: }
|