Implements the JUnit 4 standard test case class model, as defined by the annotations in the org.junit package. Many users will never notice this class: it is now the default test class runner, but it should have exactly the same behavior as the old test class runner ( {@code JUnit4ClassRunner}).
BlockJUnit4ClassRunner has advantages for writers of custom JUnit runners that are slight changes to the default behavior, however:
- It has a much simpler implementation based on {@link Statement}s, allowing new operations to be inserted into the appropriate point in the execution flow.
- It is published, and extension and reuse are encouraged, whereas {@code JUnit4ClassRunner} was in an internal package, and is now deprecated.
In turn, in 2009 we introduced {@link Rule}s. In many cases where extending BlockJUnit4ClassRunner was necessary to add new behavior, {@link Rule}s can be used, which makes the extension more reusable and composable.
@since 4.5