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

Package | org.flexunit.runner
Class | public class Description
Inheritance | Description Object
Implements | IDescription

A `Description` describes a suite, test case, or test which is to be run or has been run. `Descriptions` can be atomic (a single test) or compound (containing children tests). `Description`s are used to provide feedback about the tests that are about to run (for example, the tree view visible in many IDEs) or tests that have been run (for example, the failures view). This information can be used to report the current progress of the test run. `Description`s are implemented as a single class rather than a composite because they are entirely informational. They contain no logic aside from counting their tests.

See also

org.flexunit.runner.IRunner

Public Properties

| Property | Defined By
--- | --- | ---
|  | children : Array [read-only] | Description
|  | displayName : String [read-only] | Description
|  | EMPTY : Description [static] Global instance of an empty test description which can be returned | Description
|  | isEmpty : Boolean [read-only] | Description
|  | isInstance : Boolean [read-only] | Description
|  | isSuite : Boolean [read-only] | Description
|  | isTest : Boolean [read-only] | Description
|  | testCount : int [read-only] | Description
|  | TEST_MECHANISM : Description [static] Global instance of a failed test description for test mechanmism reasons | Description

Public Methods

| Method | Defined By
--- | --- | ---
|  | Description(displayName:String, metadata:Array, isInstance:Boolean = false) Constructor. | Description
|  | addChild(description:IDescription):void Adds an IDescription as a child of the receiver. | Description
|  | childlessCopy():IDescription Returns a copy of this description, with no children (on the assumption that some of the children will be added back). | Description
|  | createSuiteDescription(suiteClassOrName:*, metaData:Array = null):IDescription [static] Creates an IDescription named name. | Description
|  | createTestDescription(testClassOrInstance:Class, name:String, metadata:Array = null):IDescription [static] Creates a Description of a single test named name in the class testClassOrDescription. | Description
|  | equals(obj:Object):Boolean Determines if the current description is equal to the provided obj. | Description
|  | getAllMetadata():Array Returns all of the metadata that is attached to this description node. | Description

Property Detail

children | property

`children:Array` [read-only]

Implementation
`public function get children():Array`

displayName | property |

`displayName:String` [read-only]

Implementation
`public function get displayName():String`

EMPTY | property |

`public static var EMPTY:Description`

Global instance of an empty test description which can be returned

isEmpty | property |

`isEmpty:Boolean` [read-only]

Implementation
`public function get isEmpty():Boolean`

isInstance | property |

`isInstance:Boolean` [read-only]

Implementation
`public function get isInstance():Boolean`

isSuite | property |

`isSuite:Boolean` [read-only]

Implementation
`public function get isSuite():Boolean`

isTest | property |

`isTest:Boolean` [read-only]

Implementation
`public function get isTest():Boolean`

TEST_MECHANISM | property |

`public static var TEST_MECHANISM:Description`

Global instance of a failed test description for test mechanmism reasons

testCount | property |

`testCount:int` [read-only]

Implementation
`public function get testCount():int`
Constructor Detail

Description | () | Constructor

`public function Description(displayName:String, metadata:Array, isInstance:Boolean = false)`

Constructor.

Parameters

| `displayName:String` — The display name of the description node.
| `metadata:Array` — The metadata of the description node.
| `isInstance:Boolean` (default = `false`)`` — A Boolean value indicating whether the descrption node is an instance.

Method Detail

addChild | () | method

`public function addChild(description:IDescription):void`

Adds an `IDescription` as a child of the receiver.

Parameters

| `description:IDescription` — the soon-to-be child.

childlessCopy | () | method |

`public function childlessCopy():IDescription`

Returns a copy of this description, with no children (on the assumption that some of the children will be added back).

Returns

| `IDescription` — a copy of this description, with no children (on the assumption that some of the children will be added back).

createSuiteDescription | () | method |

`public static function createSuiteDescription(suiteClassOrName:*, metaData:Array = null):IDescription`

Creates an `IDescription` named `name`. Generally, you will add children to this `IDescription`.

Parameters

| `suiteClassOrName:*` — The class of the object to be described or the name of the class to be subscribed.
| `metaData:Array` (default = `null`)`` — Metadata about the test.

Returns

| `IDescription` — an `IDescription` named `name`.

createTestDescription | () | method |

`public static function createTestDescription(testClassOrInstance:Class, name:String, metadata:Array = null):IDescription`

Creates a `Description` of a single test named `name` in the class `testClassOrDescription`. Generally, this will be a leaf `IDescription`.

Parameters

| `testClassOrInstance:Class` — The class of the test.
| `name:String` — The name of the test.
| `metadata:Array` (default = `null`)`` — Metadata about the test.

Returns

| `IDescription` — an `IDescription` named `name`.

equals | () | method |

`public function equals(obj:Object):Boolean`

Determines if the current description is equal to the provided `obj`.

Parameters

| `obj:Object` — The object to check against the current description.

Returns

| `Boolean` — true if this is a description of a Runner that runs no tests

getAllMetadata | () | method |

`public function getAllMetadata():Array`

Returns all of the metadata that is attached to this description node.

Returns

| `Array` — the metadata as XML that is attached to this description node, or null if none exists

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