Packageorg.flexunit.runner
Classpublic class Description
InheritanceDescription Inheritance 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). Descriptions 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. Descriptions 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
 PropertyDefined 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
 MethodDefined 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
  
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
  
Returns all of the metadata that is attached to this description node.
Description
Property Detail
childrenproperty
children:Array  [read-only]


Implementation
    public function get children():Array
displayNameproperty 
displayName:String  [read-only]


Implementation
    public function get displayName():String
EMPTYproperty 
public static var EMPTY:Description

Global instance of an empty test description which can be returned

isEmptyproperty 
isEmpty:Boolean  [read-only]


Implementation
    public function get isEmpty():Boolean
isInstanceproperty 
isInstance:Boolean  [read-only]


Implementation
    public function get isInstance():Boolean
isSuiteproperty 
isSuite:Boolean  [read-only]


Implementation
    public function get isSuite():Boolean
isTestproperty 
isTest:Boolean  [read-only]


Implementation
    public function get isTest():Boolean
TEST_MECHANISMproperty 
public static var TEST_MECHANISM:Description

Global instance of a failed test description for test mechanmism reasons

testCountproperty 
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