Packageorg.flexunit.runners
Classpublic class Suite
InheritanceSuite Inheritance ParentRunner Inheritance Object
Implements IFilterable, IExternalDependencyRunner

A Suite is an IRunner that contains test cases and other Suites to be run during the course of a test run. The Suite is responsible for locating all non-static classes that it contains and obtaining an array of IRunners for each child that was found in this manner. The IRunnerBuilder to be used to determine the runner for the child classes is provided to the Suite during its instantiation. When a Suite goes to run a child, it is telling another IRunner to begin running, supplying the IRunner with an IRunNotifier in order to keep track of the test run. An AsyncTestToken is also provided to the child IRunner in order to notify the Suite when the child has finished. In order to declare a class as a suite class, the class must include a [Suite] and [RunWith("org.flexunit.runners.Suite")] metadata tag. The [RunWith] tag will instruct an IRunnerBuilder to use the Suite IRunner for the class.
                  
	 [Suite]
	 [RunWith("org.flexunit.runners.Suite")]
	 public class SuiteToRun
	 {
	 	public var oneTest:OneTest; //A Test
	 	public var anotherTest:AnotherTest; //Another Test
	 	public var differentSuite:DifferentSuite; //A Suite
	 }
	 
               



Public Properties
 PropertyDefined By
  dependencyWatcher : IExternalRunnerDependencyWatcher
[write-only] Setter for a dependency watcher.
Suite
  description : IDescription
[override] [read-only]
Suite
  externalDependencyError : String
[write-only] Setter to indicate an error occured while attempting to load exteranl dependencies for this test.
Suite
Protected Properties
 PropertyDefined By
  children : Array
[override] [read-only] Returns a list of objects that define the children of this Runner.
Suite
 Inheritedname : String
[read-only] Returns a name used to describe this Runner.
ParentRunner
 InheritedstopRequested : Boolean = false
private
ParentRunner
 InheritedtestClass : TestClass
[read-only] Returns a TestClass object wrapping the class to be executed.
ParentRunner
Public Methods
 MethodDefined By
  
Suite(arg1:*, arg2:*)
This will either be passed a builder, followed by an array of classes...
Suite
 Inherited
filter(filter:IFilter):void
Applies the provided Filter to the runner.
ParentRunner
  
pleaseStop():void
[override] Ask that the tests run stop before starting the next test.
Suite
 Inherited
run(notifier:IRunNotifier, previousToken:IAsyncTestToken):void
Runs the test class and updates the notifier on the status of running the tests.
ParentRunner
 Inherited
sort(sorter:ISorter):void
Applies the provided ISorter to the runner.
ParentRunner
Protected Methods
 MethodDefined By
 Inherited
Returns an IAsyncStatement: Call #runChild(Object, IRunNotifier, AsyncTestToken) on each object returned by #children() (subject to any imposed filter and sort).
ParentRunner
 Inherited
Constructs an IAsyncStatement to run all of the tests in the test class.
ParentRunner
 Inherited
collectInitializationErrors(errors:Array):void
Adds to errors an error for each problem noted with the test class (available from #testClass()).
ParentRunner
 Inherited
compare(o1:Object, o2:Object):int
This sorting method uses the runner's ISorter to compare two child arguments.
ParentRunner
  
[override] Returns an IDescription for child, which can be assumed to be an element of the list returned by ParentRunner#children().
Suite
 Inherited
Returns an IDescription of the test class that the runner is running.
ParentRunner
  
runChild(child:*, notifier:IRunNotifier, childRunnerToken:AsyncTestToken):void
[override] Runs the test corresponding to child, which can be assumed to be an element of the list returned by ParentRunner#children().
Suite
 Inherited
validatePublicVoidNoArgMethods(metaDataTag:String, isStatic:Boolean, errors:Array):void
Adds to errors if any method in this class is annotated with metaDataTag, but: is not public, or takes parameters, or returns something other than void, or is static (given isStatic is false), or is not static (given isStatic is true).
ParentRunner
 Inherited
Returns an IAsyncStatement: run all non-overridden AfterClass methods on this class and superclasses before executing the statement; all AfterClass methods are always executed: exceptions thrown by previous steps are combined, if necessary, with exceptions from AfterClass methods into a MultipleFailureException.
ParentRunner
 Inherited
Returns an IAsyncStatement: run all non-overridden BeforeClass methods on this class and superclasses before executing the statement; if any throws an Exception, stop execution and pass the exception on.
ParentRunner
Property Detail
childrenproperty
children:Array  [read-only] [override]

Returns a list of objects that define the children of this Runner.


Implementation
    protected function get children():Array
dependencyWatcherproperty 
dependencyWatcher:IExternalRunnerDependencyWatcher  [write-only]

Setter for a dependency watcher. This is a class that implements IExternalRunnerDependencyWatcher and watches for any external dependencies (such as loading data) are finalized before execution of tests is allowed to commence.


Implementation
    public function set dependencyWatcher(value:IExternalRunnerDependencyWatcher):void
descriptionproperty 
description:IDescription  [read-only] [override]


Implementation
    public function get description():IDescription
externalDependencyErrorproperty 
externalDependencyError:String  [write-only]

Setter to indicate an error occured while attempting to load exteranl dependencies for this test. It accepts a string to allow the creator of the external dependency loader to pass a viable error string back to the user.


Implementation
    public function set externalDependencyError(value:String):void
Constructor Detail
Suite()Constructor
public function Suite(arg1:*, arg2:*)

This will either be passed a builder, followed by an array of classes... (when there is not root class) Or it will be passed a root class and a builder. So, the two signatures we are supporting are: Suite( builder:IRunnerBuilder, classes:Array ) Suite( testClass:Class, builder:IRunnerBuilder )

Parameters
arg1:*
 
arg2:*
Method Detail
describeChild()method
override protected function describeChild(child:*):IDescription

Returns an IDescription for child, which can be assumed to be an element of the list returned by ParentRunner#children().

Parameters

child:* — The child to describe.

Returns
IDescription — an IDescription of the provided child.
pleaseStop()method 
override public function pleaseStop():void

Ask that the tests run stop before starting the next test. Phrased politely because the test currently running will not be interrupted.

runChild()method 
override protected function runChild(child:*, notifier:IRunNotifier, childRunnerToken:AsyncTestToken):void

Runs the test corresponding to child, which can be assumed to be an element of the list returned by ParentRunner#children(). Subclasses are responsible for making sure that relevant test events are reported through notifier.

Parameters

child:* — The child to run.
 
notifier:IRunNotifier — The IRunNotifier to notify on the progress of the child.
 
childRunnerToken:AsyncTestToken — The token used to keep track of the child's execution.