package myotherpackage; import org.testng.annotations.Configuration; import org.testng.annotations.Test; public class TestClassFour { @Configuration(beforeTest=true) public void beforeTest() { System.out.println("--TestClassFour.beforeTest"); } @Configuration(afterTest=true) public void afterTest() { System.out.println("--TestClassFour.afterTest"); } @Configuration(beforeTestClass=true) public void beforeTestClass() { System.out.println(" --TestClassFour.beforeTestClass"); } @Configuration(afterTestClass=true) public void afterTestClass() { System.out.println(" --TestClassFour.afterTestClass"); } @Configuration(beforeTestMethod=true) public void beforeTestMethod() { System.out.println(" --TestClassFour.beforeTestMethod"); } @Configuration(afterTestMethod=true) public void afterTestMethod() { System.out.println(" --TestClassFour.afterTestMethod"); } @Test public void testMethodOne() { System.out.println(" --TestClassFour.testMethodOne()"); } @Test public void testMethodTwo() { System.out.println(" --TestClassFour.testMethodTwo()"); } @Test public void testMethodThree() { System.out.println(" --TestClassFour.testMethodThree()"); } }