标签: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