JUnit 4 test suite problems

Posted by Hypnus on Stack Overflow See other posts from Stack Overflow or by Hypnus
Published on 2010-06-11T10:26:02Z Indexed on 2010/06/11 10:32 UTC
Read the original article Hit count: 199

Filed under:
|
|

Hi, i have a problem with some JUnit 4 tests that i run with a test suite.

If i run the tests individually they work with no problems but when run in a suite most of them, 90% of the test methods, fail with errors. What i noticed is that always the first tests works fine but the rest are failing. Another thing is that a few of the tests the methods are not executed in the right order (the reflection does not work as aspected - or it does because the retrieval of the methods is not necessarily in the created order). This usually happens if there is more than one test with methods that have the same name. I tried to debug some of the tests and it seems that from a line to the next the value of some attributes gets null.

Does anyone know what is the problem, or if the behavior is "normal"?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about java

Related posts about junit4