Junit4 快速入门
Junit 概念,原理这里就不说了,有兴趣的朋友可以查阅相关资料,这篇文章主要是为了快速给大家介绍一下junit4的使用 以及与 junit3的区别,这里默认大家对junit3已经有些理解了。[@more@]下面就开始吧:1.先写个简单的被测试类:package test.junit;public class BaseClass {public String method() {return this.getClass().getName();} }2.对于这个类的unit测试,我们先看看在junit3中怎么进行测试的吧:package test.junit;import junit.framework.TestCase;//引入TestCase类public class BaseClassTest extends TestCase {//类必须继承T
junit 4
New junit4 is released.(http://www.instrumentalservices.com/index.php?option=com_content&task=view&id=45&Itemid=52) No need to extend TeseCase, no need to name the method beginning with 'test' anymore:) [@more@]