I have a JUnit test class in my project which is updated incrementally - I add tests every few weeks and sometimes modify the tests' code.
Surprisingly, when I run the test class using eclipse JUnit Runner 4, it runs my old code (before the update) and not the new one. I can change the code, add or remove tests but it still runs the old code.
I tried to isolate the problem and run a single test that I've just written and got the infamous "Unrooted tests" error without any stack trace to give me a clue what the problem is.
I did some research and according to a few other threads here, many people encountered this problem with regards to JUnit 3 \ JUnit 4 compatibility, but this is not the case here - I annotate all my tests with @Test
and I do NOT extends the TestCase
class.
Cleaning / Building all eclipse projects doesn't help. However, this problem does work itself around when I mvn clean install my project, but this takes too much time. Also, renaming the class (Alt+Shift+R in eclipse) gets the new code to run immediately, but renaming it back to its original (and valid) name, gets the old code to run again (WTF?)
Help would be appreciated, 10x