1 package test.superclass; 2 3 import org.testng.annotations.BeforeClass; 4 import org.testng.annotations.BeforeMethod; 5 import org.testng.annotations.Test; 6 7 @Test 8 public class Base2 { 9 @BeforeClass 10 public void bc() { 11 ppp("BEFORE_CLASS"); 12 } 13 14 @BeforeMethod 15 public void bm() { 16 ppp("BEFORE_METHOD"); 17 } 18 19 public void tbase() { 20 ppp("TEST IN BASE"); 21 } 22 23 private static void ppp(String s) { 24 if (false) { 25 System.out.println("[Base] " + s); 26 } 27 } 28 } 29