Hi.
In Maven itself and its plugins there's a deep hierarchy of test classes based
on `PlexusTestCase`, which extends `junit.framework.TestCase`.
Although we've been using the `Junit4` library for a long time, the actual
tests are still public unannotated methods, starting with the word "test".
The current approach is to mark ignored tests as succeeded. In particular, when
testing the `maven-scm-provider-cvsexe` project in the absence of the `cvs`
binary, it prints:
Running
org.apache.maven.scm.provider.cvslib.cvsexe.command.changelog.CvsExeChangeLogCommandTest
'cvs' is not a system command. Ignored testGetCommandWithBranchOrTag.
'cvs' is not a system command. Ignored testGetCommandWithStartAndEndDate.
'cvs' is not a system command. Ignored testGetCommandWithoutEndDate.
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
This summary is undesired. It should have: `Skipped: 3`. As answered in
https://stackoverflow.com/questions/1689242/conditionally-ignoring-tests-in-junit-4
, we should use `org.junit.Assume` to conditionally skip tests, but this
doesn't work in unannotated Junit3-style test cases.
Removing TestCase from ancestors is barely an option, because our tests
actively use the methods inherited from it.
Annotating a particular class with `@RunWith(JUnit4.class)` will disable all
unannotated tests in this class and its descendants.
Is there a switch to make the JUnit4 runner run unannotated tests? Any other
ideas?
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]