Package | org.flexunit.token |
Class | public dynamic class AsyncTestToken |
Inheritance | AsyncTestToken ![]() |
Implements | IAsyncTestToken |
AsyncTestToken
is responsible for indicating that a given task has completed. The token
can then notify other tasks and provide the results of the just completed task to the notified parent
task through the use of a notification method. In order to notify a parent task about the completion of a
task performed by a child task, the parent task must add a notification method to the AsyncTestToken
using the #addNotificationMethod()
.
The AsyncTestToken
is used throughout much of FlexUnit4. It is used to notify FlexUnitCore
,
runners, statements, and parts of a test when a certain activity has finished.
Property | Defined By | ||
---|---|---|---|
parentToken : IAsyncTestToken
Returns the parentToken of the AsyncTestToken. | AsyncTestToken |
Method | Defined By | ||
---|---|---|---|
AsyncTestToken(debugClassName:String = null)
Constructor. | AsyncTestToken | ||
addNotificationMethod(method:Function, debugClassName:String = null):IAsyncTestToken
Adds a notification method to the AsyncTestToken and returns the token. | AsyncTestToken | ||
sendResult(error:Error = null):void
If any notification methods exist, invokes the notification methods with a ChildResult that
contains a references to this token and the provided error. | AsyncTestToken | ||
toString():String
Returns a string that inculdes the debugClassName, if it exists, and the
current number of listeners. | AsyncTestToken |
parentToken | property |
parentToken:IAsyncTestToken
Returns the parentToken of the AsyncTestToken
.
public function get parentToken():IAsyncTestToken
public function set parentToken(value:IAsyncTestToken):void
AsyncTestToken | () | Constructor |
public function AsyncTestToken(debugClassName:String = null)
Constructor.
ParametersdebugClassName:String (default = null ) — The name of the debug class.
|
addNotificationMethod | () | method |
public function addNotificationMethod(method:Function, debugClassName:String = null):IAsyncTestToken
Adds a notification method
to the AsyncTestToken
and returns the token.
Parameters
method:Function — A Function that will be invoked when results are sent.
| |
debugClassName:String (default = null ) — The name of the class.
|
IAsyncTestToken — this AsyncTestToken with the added method .
|
sendResult | () | method |
public function sendResult(error:Error = null):void
If any notification methods exist, invokes the notification methods with a ChildResult
that
contains a references to this token and the provided error
.
Parameters
error:Error (default = null )
|
toString | () | method |
public function toString():String
Returns a string that inculdes the debugClassName
, if it exists, and the
current number of listeners.
String |