林前Run方法:使用<code>testng 6.11</code>和写作测试,下面测试类的每个测试
public class MyTest{
public int i;
public void init(){
//initialize i
}
@Test
public void test1(){
//test some
}
@Test
public void test2(){
//Here I need fresh value of i as it would be
//right after invocation of init()
//...
//test something else
}
}
是否有可能使TestNG的运行init()
方法在测试类的每个测试的调用之前?
在我看来,像你应该阅读[一些文档(http://testng.org/doc/documentation-main.html)。这个问题非常懒惰 - 我希望获得超过5k声誉的用户更多。 –