1 package test.groupbug; 2 3 import org.testng.annotations.AfterClass; 4 import org.testng.annotations.BeforeClass; 5 import org.testng.annotations.Test; 6 7 public class ITCaseTwo { 8 9 @BeforeClass beforeClass()10 public void beforeClass() { 11 System.out.printf("RUN %s.beforeClass()\n", getClass()); 12 } 13 14 @AfterClass(alwaysRun = true) afterClass()15 public void afterClass() { 16 System.out.printf("RUN %s.afterClass()\n", getClass()); 17 } 18 19 @Test(groups = "std-two") two1()20 public void two1() { 21 GroupBugTest.passed.add("two1"); 22 System.out.printf("RUN %s.two1()\n", getClass()); 23 } 24 25 @Test(groups = "logic-two", dependsOnGroups = "std-two") two2()26 public void two2() { 27 GroupBugTest.passed.add("two2"); 28 System.out.printf("RUN %s.two2()\n", getClass()); 29 } 30 31 }