Recently, I was running a test case. When running the test case, I found that some methods can run normally, but some methods reported Org. junit.4 (the pop-up information indicates that running this method requires the support of junit4). But why does junit3 in eclipse report the information of junit4? As a result, I started to recall the latest operations. In eclipse, I started to reference junit4 to create a test case, but later I found it in junit4. Every time I run all the methods in the test case, you cannot run one of the methods, so you want to change to junit3. In junit3, you can run a method in the test case each time. If we create a test case under junit3, the running method is normal; if you run a previous test case, the previous error is reported. Therefore, it is suspected that the error is caused by changing the JUnit version.
Solution: for previously created test cases (fortunately not many, what should I do if there are many ?), Create a corresponding test case, copy the methods in the previous test case to the new test case, and then delete the previously created test case, finally, name the current test case as the previous test case name. Run the following command to check whether everything works normally and you can run a method.
BTW: Must all test cases created in junit4 be executed at a time? I am still using the problem. In short, when I want to run a method, all the methods in the test case are executed once, which is too annoying. Use junit3 first, after all, this is correct. Haha!