Packageorg.flexunit.token
Classpublic dynamic class AsyncTestToken
InheritanceAsyncTestToken Inheritance Object
Implements IAsyncTestToken

The 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.



Public Properties
 PropertyDefined By
  parentToken : IAsyncTestToken
Returns the parentToken of the AsyncTestToken.
AsyncTestToken
Public Methods
 MethodDefined 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
Property Detail
parentTokenproperty
parentToken:IAsyncTestToken

Returns the parentToken of the AsyncTestToken.


Implementation
    public function get parentToken():IAsyncTestToken
    public function set parentToken(value:IAsyncTestToken):void
Constructor Detail
AsyncTestToken()Constructor
public function AsyncTestToken(debugClassName:String = null)

Constructor.

Parameters
debugClassName:String (default = null) — The name of the debug class.
Method Detail
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.

Returns
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.

Returns
String