JUnit的报错“No tests found with test runner JUnit4”

前言】不爽!!!


Eclipse总是报错: No tests found with test runner JUnit4

首先如下几点

1 你有没有导入Junit包(eclipse中就自带了) 如果用到了spring的测试类 有没导入 spring-test包

2 你的包版本是否太低

3 有没 使用@TestCase 注解

4 有没继承TestCase类 或相关测试父类 (好像Spring-Test 不需要)

5 引用TestCase了吧

——————————————————

后来我都做到了 却又报了The input type of the launch configuration does not exist错误

解决方法:

If you are getting the above error message in Eclipse IDE, while running your test case, just make sure that you have the test class as a part of the “eclipse source folder” definition. Easiest way. Right click on the folder –> Build Path –>Use as source folder Done.
展开阅读全文

没有更多推荐了,返回首页