Packageorg.flexunit.runners.model
Interfacepublic interface IRunnerBuilder
Implementors RunnerBuilderBase

An IRunnerBuilder is a strategy for constructing IRunners for classes. Only writers of custom runners should use IRunnerBuilders. A custom runner class with a constructor taking an IRunnerBuilder parameter will be passed the instance of IRunnerBuilder used to build that runner itself. For example, imagine a custom IRunner that builds suites based on a list of classes in a text file:
	 RunWith(TextFileSuite.as)
	 SuiteSpecFile("mysuite.txt")
	 class MySuite {}
	 
The implementation of TextFileSuite might include:
	 public function TextFileSuite(testClass:Class, builder:IRunnerBuilder) {
	   // ...
	     var runner:IRunner = builder.runnerForClass( testClass );
	   // ...
	 }
	 

See also

org.flexunit.runners.Suite


Public Methods
 MethodDefined By
  
canHandleClass(testClass:Class):Boolean
Returns a boolean value indicating if this builder will be able to handle the testClass or not
IRunnerBuilder
  
runnerForClass(testClass:Class):IRunner
Returns an IRunner for a specific testClass.
IRunnerBuilder
  
runners(parent:Class, children:Array):Array
Constructs and returns a list of IRunners, one for each child class in children.
IRunnerBuilder
  
safeRunnerForClass(testClass:Class):IRunner
Returns an IRunner that can safely run the provided testClass.
IRunnerBuilder
Method Detail
canHandleClass()method
public function canHandleClass(testClass:Class):Boolean

Returns a boolean value indicating if this builder will be able to handle the testClass or not

Parameters

testClass:Class — The class to test to determine an IRunner.

Returns
Boolean
runnerForClass()method 
public function runnerForClass(testClass:Class):IRunner

Returns an IRunner for a specific testClass.

Parameters

testClass:Class — The test class for which to determine an IRunner.

Returns
IRunner — an IRunner that will run the testClass.
runners()method 
public function runners(parent:Class, children:Array):Array

Constructs and returns a list of IRunners, one for each child class in children. Care is taken to avoid infinite recursion: this builder will throw an exception if it is requested for another runner for parent before this call completes.

Parameters

parent:Class — The parent class that contains the children.
 
children:Array — The child classes for which to find IRunner.

Returns
Array — a list of IRunners, one for each child class.
safeRunnerForClass()method 
public function safeRunnerForClass(testClass:Class):IRunner

Returns an IRunner that can safely run the provided testClass.

Parameters

testClass:Class — The class to for which to determine an IRunner.

Returns
IRunner — an IRunner that can run the testClass.