码迷,mamicode.com
首页 > 其他好文 > 详细

Junit 报错 -- initializationError

时间:2017-10-01 23:07:20      阅读:230      评论:0      收藏:0      [点我收藏+]

标签:ips   右键   init   ase   java   junit   one   lips   项目   

  在使用 eclipse 做单元测试的时候,有时候会出现一种错误: initializationError

  出现这种错误是因为使用的Junit是 eclipse 默认的 3.x 版本,所以必须要继承 TestCase 这个类 【在测试类后 extends TestCase】

  若不想继承 TestCase类,则必须使用Junit 4 以上的版本才可以,先把 Junit 的 jar 包复制到 WEB-INF/lib 中,然后Build Path,然后:

  项目_右键 --> Properties --> Java Build Path --> Libraries --> Add Library --> Junit  --> Junit4 --> finish

Junit 报错 -- initializationError

标签:ips   右键   init   ase   java   junit   one   lips   项目   

原文地址:http://www.cnblogs.com/zincpool/p/7618008.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!