Package | org.flexunit.experimental.runners.statements |
Class | public class TheoryBlockRunner |
Inheritance | TheoryBlockRunner ![]() ![]() ![]() |
TheoryBlockRunner
is a runner used for running an indiviudal theory method that
has had all of its parameters assigned values. Like the BlockFlexUnit4ClassRunner
from which it extends, the TheoryBlockRunner
is based on Statement
s.
Method | Defined By | ||
---|---|---|---|
Constructor. | TheoryBlockRunner | ||
![]() |
Applies the provided Filter to the runner. | ParentRunner | |
Retrieves an object that implements a IAsyncStatement for a specific theory test method that will run
a theory with a subset of potential parameters that the theory can be run with. | TheoryBlockRunner | ||
![]() | pleaseStop():void
Ask that the tests run stop before starting the next test. | ParentRunner | |
![]() |
Runs the test class and updates the notifier on the status of running the tests. | ParentRunner | |
![]() |
Applies the provided ISorter to the runner. | ParentRunner |
Method | Defined By | ||
---|---|---|---|
![]() |
Returns an IAsyncStatement: Call #runChild(Object, IRunNotifier, AsyncTestToken)
on each object returned by #children() (subject to any imposed
filter and sort). | ParentRunner | |
![]() |
Constructs an IAsyncStatement to run all of the tests in the test class. | ParentRunner | |
collectInitializationErrors(errors:Array):void [override]
It additionally validates whether specific instances of tests are implemented correctly. | TheoryBlockRunner | ||
![]() | compare(o1:Object, o2:Object):int
This sorting method uses the runner's ISorter to compare two child arguments. | ParentRunner | |
![]() | computeTestMethods():Array
Returns the methods that run tests. | BlockFlexUnit4ClassRunner | |
createTest():Object [override]
Returns a new fixture for running a test. | TheoryBlockRunner | ||
![]() | describeChild(child:*):IDescription [override]
Returns an IDescription for child, which can be assumed to
be an element of the list returned by ParentRunner#children(). | BlockFlexUnit4ClassRunner | |
![]() |
Returns an IDescription of the test class that the runner is running. | ParentRunner | |
[override]
Returns an IStatement that, when executed, either returns normally if
method passes, or throws an exception if method fails. | TheoryBlockRunner | ||
[override]
Creates a MethodCompleteWithParamsStatement that is used to execute the theory method for
a specific set of Assignments. | TheoryBlockRunner | ||
![]() | possiblyExpectingExceptions(method:FrameworkMethod, test:Object, statement:IAsyncStatement):IAsyncStatement
Returns an IAsyncStatement: if method's Test annotation
has the expecting attribute, return normally only if next
throws an exception of the correct type, and throw an exception otherwise. | BlockFlexUnit4ClassRunner | |
![]() | [override]
Runs the test corresponding to child, which can be assumed to be
an element of the list returned by ParentRunner#children(). | BlockFlexUnit4ClassRunner | |
![]() | validateInstanceMethods(errors:Array):void
Adds to errors for each method annotated with Test,
Before, or After that is not a public, void instance
method with no arguments. | BlockFlexUnit4ClassRunner | |
![]() | validatePublicVoidNoArgMethods(metaDataTag:String, isStatic:Boolean, errors:Array):void
Adds to errors if any method in this class is annotated with
metaDataTag, but:
is not public, or
takes parameters, or
returns something other than void, or
is static (given isStatic is false), or
is not static (given isStatic is true).
| ParentRunner | |
![]() | validateTestMethods(errors:Array):void
Adds to errors for each method annotated with Test that
is not a public, void instance method with no arguments. | BlockFlexUnit4ClassRunner | |
![]() |
Returns an IAsyncStatement: run all non-overridden AfterClass methods on this class
and superclasses before executing the statement; all AfterClass methods are
always executed: exceptions thrown by previous steps are combined, if
necessary, with exceptions from AfterClass methods into a
MultipleFailureException. | ParentRunner | |
![]() |
Returns an IAsyncStatement: run all non-overridden After
methods on this class and superclasses before running next; all
After methods are always executed: exceptions thrown by previous steps
are combined, if necessary, with exceptions from After methods into a
MultipleFailureException. | BlockFlexUnit4ClassRunner | |
![]() | BlockFlexUnit4ClassRunner | ||
![]() |
Returns an IAsyncStatement: run all non-overridden BeforeClass methods on this class
and superclasses before executing the statement; if any throws an
Exception, stop execution and pass the exception on. | ParentRunner | |
![]() |
Returns an IAsyncStatement: run all non-overridden Before
methods on this class and superclasses before running statement; if
any throws an Exception, stop execution and pass the exception on. | BlockFlexUnit4ClassRunner | |
![]() |
Returns an IAsyncStatement that invokes method on a decorated test. | BlockFlexUnit4ClassRunner | |
[override]
Returns an IAsyncStatement: if method's Test annotation
has the async attribute, throw an exception if next
encounters an exception during execution. | TheoryBlockRunner | ||
![]() |
Potentially returns a new IAsyncStatement defined by the user on the testcase via the Rule metadata. | BlockFlexUnit4ClassRunner | |
![]() | withPotentialTimeout(method:FrameworkMethod, test:Object, statement:IAsyncStatement):IAsyncStatement
Returns an IAsyncStatement: if method's Test annotation
has the timeout attribute, throw an exception if next
takes more than the specified number of milliseconds. | BlockFlexUnit4ClassRunner | |
![]() |
Returns an IAsyncStatement that manages the stack and allow execution to break across frames. | BlockFlexUnit4ClassRunner |
TheoryBlockRunner | () | Constructor |
public function TheoryBlockRunner(klass:Class, anchor:TheoryAnchor, complete:Assignments)
Constructor.
Parametersklass:Class — The class that contains the theory.
| |
anchor:TheoryAnchor — The anchor associated with the theory method.
| |
complete:Assignments — Contains the parameters used for the theory method.
|
collectInitializationErrors | () | method |
override protected function collectInitializationErrors(errors:Array):void
It additionally validates whether specific instances of tests are implemented correctly.
Adds to errors
an error for each problem noted with the test class
(available from #testClass()
).
Default implementation adds an error for each method annotated with
BeforeClass
or AfterClass
that is not
public static void
with no arguments.
Parameters
errors:Array — An Array of issues encountered when attempting to setup
the runner for the test class.
|
createTest | () | method |
override protected function createTest():Object
Returns a new fixture for running a test. Default implementation executes the test class's no-argument constructor (validation should have ensured one exists).
ReturnsObject |
getMethodBlock | () | method |
public function getMethodBlock(method:FrameworkMethod):IAsyncStatement
Retrieves an object that implements a IAsyncStatement
for a specific theory test method that will run
a theory with a subset of potential parameters that the theory can be run with.
Parameters
method:FrameworkMethod — The FrameworkMethod theory to test.
|
IAsyncStatement — an object that implements a IAsyncStatement for a specific theory test.
|
methodBlock | () | method |
override protected function methodBlock(method:FrameworkMethod):IAsyncStatement
Returns an IStatement that, when executed, either returns normally if
method
passes, or throws an exception if method
fails.
Here is an outline of the default implementation:
method
on test
, and
throw any exceptions thrown by either operation.method
's Test
annotation has the
expecting
attribute, return normally only if the previous step threw an
exception of the correct type, and throw an exception otherwise.method
's Test
annotation has the
timeout
attribute, throw an exception if the previous step takes more
than the specified number of milliseconds.Before
methods on this class
and superclasses before any of the previous steps; if any throws an
Exception, stop execution and pass the exception on.After
methods on this class
and superclasses before any of the previous steps; all After methods are
always executed: exceptions thrown by previous steps are combined, if
necessary, with exceptions from After methods into a
MultipleFailureException
.This can be overridden in subclasses, either by overriding this method, or the implementations creating each sub-statement.
Parameters
method:FrameworkMethod |
IAsyncStatement |
methodInvoker | () | method |
override protected function methodInvoker(method:FrameworkMethod, test:Object):IAsyncStatement
Creates a MethodCompleteWithParamsStatement
that is used to execute the theory method for
a specific set of Assignments
.
Returns an IAsyncStatement
that invokes method
on test
Parameters
method:FrameworkMethod | |
test:Object |
IAsyncStatement |
withPotentialAsync | () | method |
override protected function withPotentialAsync(method:FrameworkMethod, test:Object, statement:IAsyncStatement):IAsyncStatement
Returns an IAsyncStatement
: if method
's Test
annotation
has the async
attribute, throw an exception if next
encounters an exception during execution.
Parameters
method:FrameworkMethod | |
test:Object | |
statement:IAsyncStatement |
IAsyncStatement |