|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.junit.runner.Runner
org.junit.runners.ParentRunner<FrameworkMethod>
org.junit.runners.BlockJUnit4ClassRunner
org.junit.runners.parameterized.BlockJUnit4ClassRunnerWithParameters
public class BlockJUnit4ClassRunnerWithParameters
A BlockJUnit4ClassRunner with parameters support. Parameters can be
injected via constructor or into annotated fields.
| Constructor Summary | |
|---|---|
BlockJUnit4ClassRunnerWithParameters(TestWithParameters test)
|
|
| Method Summary | |
|---|---|
protected Statement |
classBlock(RunNotifier notifier)
Constructs a Statement to run all of the tests in the test class. |
Object |
createTest()
Returns a new fixture for running a test. |
protected String |
getName()
Returns a name used to describe this Runner |
protected Annotation[] |
getRunnerAnnotations()
|
protected String |
testName(FrameworkMethod method)
Returns the name that describes method for Descriptions. |
protected void |
validateConstructor(List<Throwable> errors)
Adds to errors if the test class has more than one constructor,
or if the constructor takes parameters. |
protected void |
validateFields(List<Throwable> errors)
|
| Methods inherited from class org.junit.runners.ParentRunner |
|---|
childrenInvoker, classRules, createTestClass, filter, getDescription, getTestClass, order, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses, withInterruptIsolation |
| Methods inherited from class org.junit.runner.Runner |
|---|
testCount |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BlockJUnit4ClassRunnerWithParameters(TestWithParameters test)
throws InitializationError
InitializationError| Method Detail |
|---|
public Object createTest()
throws Exception
BlockJUnit4ClassRunner
createTest in class BlockJUnit4ClassRunnerExceptionprotected String getName()
ParentRunner
getName in class ParentRunner<FrameworkMethod>protected String testName(FrameworkMethod method)
BlockJUnit4ClassRunnermethod for Descriptions.
Default implementation is the method's name
testName in class BlockJUnit4ClassRunnerprotected void validateConstructor(List<Throwable> errors)
BlockJUnit4ClassRunnererrors if the test class has more than one constructor,
or if the constructor takes parameters. Override if a subclass requires
different validation rules.
validateConstructor in class BlockJUnit4ClassRunnerprotected void validateFields(List<Throwable> errors)
validateFields in class BlockJUnit4ClassRunnerprotected Statement classBlock(RunNotifier notifier)
ParentRunnerStatement to run all of the tests in the test class.
Override to add pre-/post-processing. Here is an outline of the
implementation:
ParentRunner.getChildren()
(subject to any imposed filter and sort).ClassRules on the test-class and superclasses.@BeforeClass methods on the test-class
and superclasses; if any throws an Exception, stop execution and pass the
exception on.@AfterClass methods on the test-class
and superclasses: exceptions thrown by previous steps are combined, if
necessary, with exceptions from AfterClass methods into a
MultipleFailureException.
classBlock in class ParentRunner<FrameworkMethod>Statementprotected Annotation[] getRunnerAnnotations()
getRunnerAnnotations in class ParentRunner<FrameworkMethod>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||