I m developing Scala code using Eclipse, often when I run tests I get this error:
No tests found with test runner JUnit 3 .
Environment:
- Eclipse for Java Developers, 3.5.1
- Scala 2.7.7
- JUnit 4.7
I m currently writing my tests as JUnit3 tests, and invoking them by right clicking on a package in the project explorer, choosing Run As -> JUnit Test. (I was writing them as JUnit4 tests but ran into even more problems.)
If I fire up eclipse, the tests may not run unless I first open the source code file for the test. If I do open the source code file for the test, it will run. However, often then when I make any modification to the test file or any other source code file, Eclipse will refuse to run my tests, saying: "No tests found with test runner JUnit 3 ."
I just repeated this just now:
- Open eclipse
- Open the .scala file with some tests
- Invoke the tests by right clicking on the package for that file in the project explorer and choosing Run As -> JUnit Test
- It ran the tests
- One failed
- I changed a string literal in the failing test to fix it
- I then re-launced the test using the same method, and I get the dreaded "No tests found with test runner JUnit 3 ."
- I get this same method using other methods of launching the tests, e.g. JUnit buttons or menus to re-run all or some tests
To get the tests to run again I close and re-open Eclipse... So I end up relaunching Eclipse many many times a day.
Note: I do often use XML literals in my tests, I wonder if that has anything to do with it.
2nd Note: See my answer to this thread: What is the current state of the Scala Eclipse plugin? where I described some of the other problems I m having with Scala+Eclipse. Most of the problems are just minor annoyances, but this test invocation problem is a real time waster, would love to find a way around it!