1 package test.tmp; 2 3 import org.testng.annotations.Configuration; 4 import org.testng.annotations.Test; 5 6 public class ParentTest { 7 8 @Configuration(beforeTestMethod = true) btm1()9 public void btm1() { 10 ppp("PARENT BEFORE TEST"); 11 } 12 13 @Configuration(afterTestMethod = true) atm1()14 public void atm1() { 15 ppp("PARENT AFTER TEST"); 16 } 17 18 @Test t1()19 public void t1() { 20 ppp("TEST PARENT"); 21 } 22 ppp(String string)23 private void ppp(String string) { 24 System.out.println("[Parent] " + string); 25 } 26 27 28 29 } 30