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