readthefuckingmanual.net

[SOLVED] Unrooted Tests.

Error added: 2009-12-21T06:37:18Z

0 people waiting for the answer...

3 answers found.

Answer 1223 (75.0% helpful)

Some Junit tests prefixed with @Test would not run, and when individually selected they would give the error: Unrooted Tests, caused by InitializationError0.
After doing \'mvn clean install\' the tests were OK.
Permalink

Answer 1260 (0.0% helpful)

I had the same problem. I am using 3.8 and I have built a framework to run common tests on objects in our project where TestCase is rooted in the heirarchy. One TestCase happens to be implementing an interface and has to override the equals and hashCode methods (for various OO reasons) and the equals method was checking for the wrong instanceof: i.e., my test class is called Foo extends ProjectBaseTest extends TestCast and the equals method of Foo was checking to see if the instance was Bar. In summary, the equals method was alway\'s returning false. I corrected the implementation of the equals method and Unrooted Tests no longer exists. Check out my blog for a more detailed description: http://whatwouldtroydo.blogspot.com/
Permalink

Answer 1261 (0.0% helpful)

I had the same problem. I am using 3.8 and I have built a framework to run common tests on objects in our project where TestCase is rooted in the heirarchy. One TestCase happens to be implementing an interface and has to override the equals and hashCode methods (for various OO reasons) and the equals method was checking for the wrong instanceof: i.e., my test class is called Foo extends ProjectBaseTest extends TestCast and the equals method of Foo was checking to see if the instance was Bar. In summary, the equals method was alway\'s returning false. I corrected the implementation of the equals method and Unrooted Tests no longer exists. 
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: