1 package test.dependent; 2 3 import org.testng.annotations.AfterClass; 4 import org.testng.annotations.BeforeClass; 5 import org.testng.annotations.Test; 6 7 import java.util.ArrayList; 8 import java.util.List; 9 10 @Test 11 public class DepBugSampleTest { 12 private static List<String> m_log = new ArrayList<>(); 13 log(String s)14 private static void log(String s) { 15 // ppp(s); 16 m_log.add(s); 17 } 18 ppp(String s)19 private static void ppp(String s) { 20 System.out.println("[DepBugSampleTest] " + s); 21 } 22 getLog()23 public static List<String> getLog() { 24 return m_log; 25 } 26 27 @BeforeClass setup()28 public void setup() throws Exception { 29 log("setup"); 30 } 31 32 @AfterClass destroy()33 public void destroy() throws Exception { 34 log("destroy"); 35 } 36 37 @Test(dependsOnMethods = "send") get()38 public void get() throws Exception { 39 log("get"); 40 } 41 send()42 public void send() throws Exception { 43 log("send"); 44 } 45 46 } 47