1 package test.configurationfailurepolicy; 2 3 import org.testng.annotations.BeforeClass; 4 import org.testng.annotations.BeforeMethod; 5 import org.testng.annotations.Test; 6 7 public class ClassWithFailedBeforeClassMethod { 8 9 @BeforeClass 10 public void setupClassFails() { 11 throw new RuntimeException( "setup class fail" ); 12 } 13 14 @BeforeMethod 15 public void setupMethod() { 16 17 } 18 19 @Test 20 public void test1() { 21 22 } 23 } 24