1package test.thread; 2 3import org.testng.ITestContext; 4import org.testng.annotations.BeforeMethod; 5import org.testng.annotations.Test; 6 7public class Sample2 extends BaseThreadTest { 8 9 @BeforeMethod 10 public void before(ITestContext ctx) { 11 logSuite(ctx.getSuite().getName(), System.currentTimeMillis()); 12 } 13 14 @Test 15 public void s1() { 16 logThread(Thread.currentThread().getId()); 17 } 18} 19