API Documentation | All Packages | All Classes | Index | Frames No Frames |
AsyncTestToken

Package | org.flexunit.token
Class | public dynamic class AsyncTestToken
Inheritance | AsyncTestToken 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

| Property | Defined By
--- | --- | ---
|  | parentToken : IAsyncTestToken Returns the parentToken of the AsyncTestToken. | AsyncTestToken

Public Methods

| 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

Property Detail

parentToken | property

`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`

Thu Apr 10 2014, 08:07 AM +10:00