Junit4-Test is not an annotation type

来源:互联网 发布:清华软件学院 专硕 编辑:程序博客网 时间:2024/04/30 04:23

今天急着要测试某个方法,但缺遇到了这个问题,浪费了更多的时间,之前都是可以用Junit4的。


  1. 如果Ctrl+Shift+O无法自动import,我手动引入,手动输入全路径
  2. 当我手动引入包后,报信息:The import org.junit.Test conflicts with a type defined in the same file

这时我才发现我的测试类的名字叫Test,换个名字就好了。不能偷懒,命名很重要!

0 0