I have a suite, inside which I have added the test class. I am using surefire to run my JUnits. My test class ends with test and the methods has @test annotations to it.
How can this problem be resolved?
Here are various suggestions for this incomplete question (for those unfortunate enough to be brought here by google looking for an answer to this common issue):
if using Junit4.x, just use annotations (@Test); don't create a test suite: see this question for details.
original question said "@Test" annotation is being used, which should prevent the error. But it can still happen if there are other errors that happen earlier, and junit can hide the original problem with this message. E.g., see if there are problems with Spring configuration (unset @Required attributes), misconfigured mock objects, etc.
to avoid other frequent issues that also may generate this error (such as running classes suffixed by "*Test" that do not have any @Test methods), try updating to the surefire plugin 2.7 (currently @2.8.1) and junit 4.7+ (currently @4.8.1) to avoid this issue (i'm using maven3, btw; perhaps do a "mvn clean" before "mvn test" to be safe)
long shot: upgrade to at least ant 1.7+ (currently 1.8+) to avoid junit 4 test suite issues
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With