1 package test.simple; 2 3 import org.testng.Reporter; 4 import org.testng.annotations.BeforeClass; 5 import org.testng.annotations.BeforeMethod; 6 import org.testng.annotations.BeforeSuite; 7 import org.testng.annotations.BeforeTest; 8 import org.testng.annotations.Test; 9 10 public class IncludedExcludedSampleTest { 11 12 @BeforeSuite beforeSuite()13 public void beforeSuite() { 14 Reporter.log("beforeSuite"); 15 } 16 17 @BeforeTest beforeTest()18 public void beforeTest() { 19 Reporter.log("beforeTest"); 20 } 21 22 @BeforeClass beforeTestClass()23 public void beforeTestClass() { 24 Reporter.log("beforeTestClass"); 25 } 26 27 @BeforeMethod beforeTestMethod()28 public void beforeTestMethod() { 29 Reporter.log("beforeTestMethod"); 30 } 31 32 @Test test1()33 public void test1() { 34 Reporter.log("Child.test1"); 35 } 36 37 @Test(enabled = false) test2()38 public void test2() { 39 Reporter.log("Child.test2"); 40 } 41 42 @Test(groups = "a") test3()43 public void test3() { 44 Reporter.log("Child.test3"); 45 } 46 ppp(String string)47 private void ppp(String string) { 48 System.out.println("[TestNGBug] " + string); 49 } 50 } 51