最近看了测试的技术,以前一直用Junit, 最近发现TesTNG也很不错,功能非常全面,学习了。
package example1;
import org.testng.annotations.*;
public class SimpleTest {
@BeforeClass
public void setUp() {
// code that will be invoked when this test is instantiated
}
@Test(groups = { "fast" })
public void aFastTest() {
System.out.println("Fast test");
}
@Test(groups = { "slow" })
public void aSlowTest() {
System.out.println("Slow test");
}
}
另外一些 TestNG 学习的例子:
http://www.asjava.com/testng/testng-tutorials/
http://www.asjava.com/testng/testng-basic-concepts-and-annotations/