1package test.testng317; 2 3import org.testng.annotations.Test; 4 5public class ClassB { 6 @Test 7 public void sameNameAA(){ 8 printMethod(); 9 } 10 @Test (dependsOnMethods="sameNameAA") 11 public void uniqueNameBB(){ 12 printMethod(); 13 } 14 @Test (dependsOnMethods="uniqueNameBB") 15 public void uniqueNameCC(){ 16 printMethod(); 17 } 18 @Test (dependsOnMethods="uniqueNameCC") 19 public void uniqueNameDD(){ 20 printMethod(); 21 } 22 @Test (dependsOnMethods="uniqueNameDD") 23 public void sameNameE(){ 24 printMethod(); 25 } 26 27 public void nullTest(){ 28 printMethod(); 29 } 30 protected void printMethod() { 31 StackTraceElement[] sTrace = new Exception().getStackTrace(); 32 String className = sTrace[0].getClassName(); 33 String methodName = sTrace[1].getMethodName(); 34 35 System.out.printf("*********** executing --- %s %s\n", className, methodName); 36 37 VerifyTest.m_methods.add(className + "." + methodName); 38 } 39} 40