When running all my tests in Eclipse (Eclipse 3.4 'Ganymede'), one test is listed under "Unrooted Tests". I'm using Junit 3.8 and this particular test extends TestCase. I do not see any difference between this test and the other tests. I don't remember seeing this occur in Eclipse 3.3 (Europa).
Clarification:
We haven't moved to JUnit 4.0 yet, so we are not using annotations. I also googled and it seemed like most people were having issues with JUnit 4, but I did not see any solutions. At this point the test passes both locally and in CruiseControl so I'm not overly concerned, but curious.
When I first saw this, though, it was on a failing test that only failed when run with other tests. This led me down the rabbit hole looking for a solution to the "Unrooted" issue that I never found. Eventually I found the culprit in another test that was not properly tearing down.
I agree, it does seem like an Eclipse issue.
Do not extend junit.framework.TestCase in your test class with junit1.4 and this should solve the problem
For me the problem was, that an exception was thrown in the
@BeforeClass
or@AfterClass
methods. This will also cause tests to be categorized as unrooted.For me, it was due to the project got build path issues. My maven dependencies configuration needs to be updated.
I had that problem and putting one "@Test" before the test method solved it!
like this:
@Test public void testOne() { // ... assertTrue(1 == 1); }
I got this error with the test method name as "test"
I renamed the method and it worked
One other thing you can try is to upgrade your version of JUnit to at least 4.12.
I was experiencing this problem for a while with a class that extended one that used @RunWith(Parameterized.class).
After a while, and I'm sorry that I don't know precisely what I did to cause this, the 'Unrooted Tests' message went away, but the test still didn't run correctly. The constructor that should have accepted arguments from the @Parameters method was never getting called; execution jumped straight from @BeforeClass to @AfterClass.
The fix for that problem was to upgrade JUnit from the 4.8.1 it was using, to the latest (4.12). So maybe that could help someone else in the future.