1 package test.testng317; 2 3 import org.testng.annotations.Test; 4 5 6 public class ClassA { 7 @Test 8 public void sameNameA(){ 9 printMethod(); 10 } 11 @Test (dependsOnMethods="sameNameA") 12 public void uniqueNameB(){ 13 printMethod(); 14 } 15 @Test (dependsOnMethods="uniqueNameB") 16 public void uniqueNameC(){ 17 printMethod(); 18 } 19 @Test (dependsOnMethods="uniqueNameC") 20 public void uniqueNameD(){ 21 printMethod(); 22 } 23 @Test (dependsOnMethods="uniqueNameD") 24 public void sameNameE(){ 25 printMethod(); 26 } 27 @Test (dependsOnMethods="sameNameE") 28 public void sameNameF(){ 29 printMethod(); 30 } 31 @Test (dependsOnMethods="sameNameF") 32 public void sameNameG(){ 33 printMethod(); 34 } 35 @Test (dependsOnMethods="sameNameG") 36 public void sameNameH(){ 37 printMethod(); 38 } 39 40 public void nullTest(){ 41 printMethod(); 42 } 43 protected void printMethod() { 44 StackTraceElement[] sTrace = new Exception().getStackTrace(); 45 String className = sTrace[0].getClassName(); 46 String methodName = sTrace[1].getMethodName(); 47 48 System.out.printf("*********** executing --- %s %s\n", className, methodName); 49 50 VerifyTest.m_methods.add(className + "." + methodName); 51 } 52 } 53