一个Testng的测试例子

来源:互联网 发布:淘宝客自动赚钱软件 编辑:程序博客网 时间:2024/05/17 01:28

最近看了测试的技术,以前一直用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/