1. 程式人生 > >JUnit的報錯“No tests found with test runner JUnit4”和“The input type of the launch configuration does not exist”

JUnit的報錯“No tests found with test runner JUnit4”和“The input type of the launch configuration does not exist”

【前言】不爽!!!

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.

點著你的包右擊點 buildPath

Use as source folder Done.