package cases; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterMethod; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class TestCase2 { @BeforeTest public void setUp(){ System.out.println("*******before********"); } @BeforeMethod public void beforeMethod(){ System.out.println("*******beforeMethod********"); } @AfterMethod public void afterMethod(){ System.out.println("*******aftermethod********"); } @Test public void t1(){ System.out.println("*********t1**********"); } @Test public void t2(){ System.out.println("*********t2**********"); } @BeforeClass public void beforeClass(){ System.out.println("*****beforeClass*****"); } @AfterClass public void afterClass(){ System.out.println("*****afterClass*****"); } @AfterTest public void finish(){ System.out.println("*******finish********"); } } |