I have a problem situation with some pretty advanced unit tests (using PowerMock for bullying and JUnit 4.5). Without going into details, the first test case of a test class will always be successful, but any subsequent test cases in the same test class will fail. However, if I choose to only run a test case of 5 out of 10, for example, it will pass. Thus, all tests pass at startup separately. Is there a way to get JUnit to run one test case at a time? I am calling JUnit from ant - script.
I know the problem of dependent test cases, but I cannot pinpoint why this is so. In test cases, there are no stored variables, so nothing should be done in the @Before annotation. This is why I am looking for an emergency solution, such as forcing JUnit to run separate tests.
java unit-testing junit testing ant
Ciryon
source share