org.junit.runners
Class BlockJUnit4ClassRunner
java.lang.Object
org.junit.runner.Runner
org.junit.runners.ParentRunner<FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
- All Implemented Interfaces:
- Describable, Filterable, Sortable
- Direct Known Subclasses:
- JUnit4, Theories
public class BlockJUnit4ClassRunner
- extends ParentRunner<FrameworkMethod>
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 (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
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
JUnit4ClassRunner
was in an internal package, and is now deprecated.
BlockJUnit4ClassRunner
public BlockJUnit4ClassRunner(Class<?> klass)
throws InitializationError
- Creates a BlockJUnit4ClassRunner to run
klass
- Throws:
InitializationError
- if the test class is malformed.