I'm trying to use @BeforeTest to get code to ... run once before every test.
This is my code:
public class TestBase {
@BeforeTest
public void before() {
System.out.println("BeforeTest");
}
}
public class TestClass extends TestBase{
@Test
public void test1(){}
@Test
public void test2(){}
}
"BeforeTest" is only printed once, not twice. What am I doing wrong?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…