|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 Description s. |
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, run, runLeaf, setScheduler, sort, validatePublicVoidNoArgMethods, withAfterClasses, withBeforeClasses |
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 BlockJUnit4ClassRunner
Exception
protected String getName()
ParentRunner
getName
in class ParentRunner<FrameworkMethod>
protected String testName(FrameworkMethod method)
BlockJUnit4ClassRunner
method
for Description
s.
Default implementation is the method's name
testName
in class BlockJUnit4ClassRunner
protected void validateConstructor(List<Throwable> errors)
BlockJUnit4ClassRunner
errors
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 BlockJUnit4ClassRunner
protected void validateFields(List<Throwable> errors)
validateFields
in class BlockJUnit4ClassRunner
protected Statement classBlock(RunNotifier notifier)
ParentRunner
Statement
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).ClassRule
s 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>
Statement
protected Annotation[] getRunnerAnnotations()
getRunnerAnnotations
in class ParentRunner<FrameworkMethod>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |