Juint2.*套件测试

来源:互联网 发布:nginx epoll模型 编辑:程序博客网 时间:2024/05/17 02:39

把多个单例测试组合成套件一起测试。

有MyTest、TestMain两个类,代码如下:

 

 

 

 

普通运行输出如下:

.=====setUp======
=====testMethodA start======
=====testMethodA end======
=====tearDown======

Time: 0


Junit运行输出如下:

test count:2
=====setUp======
=====testMethodA start======
=====testMethodA end======
=====testMethodB start======
=====tearDown======
=====TestMain.testMethodA start======
=====TestMain.testMethodA end======

 

参考资料地址:http://wenku.baidu.com/view/3504b7f8941ea76e58fa04f8.html