1 package test.testng106; 2 3 import java.util.Arrays; 4 5 import org.testng.Assert; 6 import org.testng.TestNG; 7 import org.testng.annotations.Test; 8 import org.testng.xml.XmlSuite; 9 10 import test.SimpleBaseTest; 11 12 public class TestNG106 extends SimpleBaseTest { 13 @Test 14 public void testFailingBeforeSuiteShouldSkipAllTests() throws Exception { 15 TestNG tng = create(); 16 XmlSuite s = createXmlSuite("TESTNG-106"); 17 createXmlTest(s, "myTest1", FailingSuiteFixture.class.getName(), Test1.class.getName()); 18 createXmlTest(s, "myTest2", Test1.class.getName()); 19 createXmlTest(s, "myTest3", Test2.class.getName()); 20 createXmlTest(s, "myTest-last", Test2.class.getName()); 21 tng.setXmlSuites(Arrays.asList(s)); 22 tng.run(); 23 Assert.assertEquals(FailingSuiteFixture.s_invocations, 0, "@BeforeSuite has failed. All tests should be skipped."); 24 } 25 } 26