import junit.framework.TestCase;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
/**
* author beneo
* Date: Dec 10, 2010
* Time: 10:42:36 AM
*/
public class Demo extends TestCase {
@BeforeMethod
protected void setUp() throws Exception {
System.out.println(" --- setup --- ");
}
@Test
public void testDemon() {
System.out.println(" --- ok --- ");
}
}
我成功了。。
junit
junit
3.8.2
org.testng
testng
5.14.2
引用
@BeforeClass
public static void beforeClass() throws Exception {
...
}
你得beofreclass没有override setup() in junit吧