TestNG 在maven2 的pom.xml文件里的配置:
Configuring TestNG
To get started with TestNG, include the following dependency in your project:
[...]
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>5.8</version>
...
http://testng.org/doc/
TestNG is a testing framework inspired from JUnit and NUnit but introducing
some new functionalities that make it more powerful and easier to use, such as:
JDK 5 Annotations (JDK 1.4 is also supported with JavaDoc annotations).
Flexible test configuration.
...
maven version 2.08
java version 1.6.0_06
在pom.xml里加入:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
< ...
Fixture
http://www.blogjava.net/relax/archive/2007/03/05/101945.html
何
谓
Fixture?它是指在执行一个或者多个测试方法时需要的一系列公共资源或者数据,例如测试环境,测试数据等等。在编写单元测试的过程中,您会发现在大
部分的测试方法在进行真正的测试之前都需要做大量的铺垫——为设计准备 Fixture
而忙碌。这些铺垫过程占据的代码往往比真正测试的代码多得多,而且这个比率随着测试的复杂程度的增加而递增 ...
每当你接获臭虫提报时,请先撰写一个单元测试来揭发这只臭虫。
Junit这个单元测试框架可以很好地检测我们的代码。
比较喜欢Junit4的annotation,不错。
http://junit.sourceforge.net/doc/cookbook/cookbook.htm
Junit4 test demo:
public class AddOperationTest extends TestCase{
public AddOperationTest() {
}
@Before
public void set ...
我的相册
Screenshot-2.png
共 3 张
共 3 张
最近加入圈子
最新评论
-
Ajax File Upload - For S ...
pom.xml放在什么地方?能解答一下吗?
-- by ws715 -
javascript ===
那我也很无知,受教了
-- by lengyubing -
基于struts2+spring+hiber ...
最近正在学习这方面的知识,能否提供一份源代码谢谢哦!哈 etao528@163. ...
-- by etao528 -
基于struts2+spring+hiber ...
有源码吗?谢谢!正在学习中
-- by etao528 -
基于struts2+spring+hiber ...
初学者,照猫画虎,一直没有成功
-- by xianhui







评论排行榜