2 Minutes To Code (β Version)

JUnit 3.10 - 2 minute tutorial

Suite : How to create a suite to test multiple classes

To test multiple suites, you need to use the same approach as in the previous example on testing multiple classes.

The difference is that instead of using the method addTest of class junit.framework.TestSuite, we need to use the method addTestSuite with the test class name as argument.

The other requirement is that, this test class should have a public static method suite that returns an instance of junit.framework.TestSuite to which the test classes have been added as in the previous example.

Finally, just run this parent suite using the run method of class junit.textui.TestRunner.