我在一个类里先写了testCompress方法,Junit测试正常运行,然后更进一步增加了testBatchCompress()对testCompress方法进行调用,用JUnit测试报method initializationerror not found:错误:提示页面如下:

JUnit报错method initializationerror not found的解决方法


JUnit报错method initializationerror not found的解决方法

,然后查询解决问题方法,有说在导入junit.jar之后还要导入hamcrest-core-1.3.jar,hamcrest-library-1.3.jar,

JUnit报错method initializationerror not found的解决方法

根据建议导入junit.jar后,再junit运行testBatchCompress测试方法,还是报错,另看帖子说需要加方法前public,我的方法里都带有public,应该不存在此问题,最后我把testCompress方法上的@Test去掉后,测试运行成功。

JUnit报错method initializationerror not found的解决方法

相关文章:

  • 2022-01-16
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
  • 2021-10-28
  • 2021-08-09
  • 2021-08-09
  • 2021-08-09
猜你喜欢
  • 2021-08-09
  • 2021-09-11
  • 2021-08-09
  • 2021-12-03
  • 2021-08-09
  • 2021-08-09
相关资源
相似解决方案