Using custom runners

This section will introduce different extensions that are helpful for structuring your test universe. Further, we'll shed some light on the consequences of overdone runner usage.

Furnishing a suite with test cases

Probably one of the best known runners is Suite. Its purpose is to compose several test cases and/or other suites into a single entity that is processable by JUnit, which allows an example to combine all test cases of a subsystem. This might be an appropriate excerpt with respect to the overall test execution duration on your local machine—if you're about to enhance some of the subsystem's capabilities.

The suite-defining class has normally no body implementation. The composition is accomplished by means of the @SuiteClasses ...

Get Testing with JUnit now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.