I'd like to create a "generic" JUnit 4 test that can be used as follows:
- It is an abstract base class
- It can be packaged into a jar file
- Users can include the jar as a dependency in their own projects
- Users can create their own JUnit tests by extending the abstract class and adding implementations for the key methods
- The JUnit tests will then run when the users run JUnit on their own projects (along with any other JUnit tests the user may have written)
- The test suite may return multiple results from running different sub-tests, ideally the user should be able to see this breakdown of results in their IDE
The motivation for this is that the class defines a standard test procedure that may be useful in many different projects, but require some customisation by the user in each case.
Is this possible with JUnit 4, and if so how should I do it?