- 4
- 0
- 约3.81千字
- 约 8页
- 2017-01-19 发布于重庆
- 举报
testng與junit的对比
Testng与junit对比
总体概念
TestNG,即Testing, Next Geneation,下一代测试技术,是一套根据JUnit 和 NUnit思想而构建的利用注释来强化测试功能的一个测试框架,即可以用来做单元测试,也可以用来做集成测试。testNG的运行需要一个配置文件,默认为testng.xml,其描述了要运行哪些测试等配置。
?下面来看一下,如何来实现测试的,与JUnit4 差不多。声明测试方法如下:
@Test public void testMethod1() { System.out.println(in testMethod1); }@Test public void testMethod2() { System.out.println(in testMethod2); }
???? 基本上都是采用java的注释实现的。???? 与JUnit4 不同在于,测试方法可以分组,它可以根据诸如运行时间这样的特征来对测试分类。
@Test(groups={fun1,fun2}) public void testMethod1() { System.out.println(in testMethod1); }@Test(groups={f
原创力文档

文档评论(0)