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

Package | org.flexunit.runners.model
Class | public class RunnerBuilderBase
Inheritance | RunnerBuilderBase Object
Implements | IRunnerBuilder
Subclasses | AllDefaultPossibilitiesBuilder, FlexUnit1Builder, FlexUnit4Builder, IgnoredBuilder, MetaDataBuilder, NullBuilder, SuiteMethodBuilder

The `RunnerBuilderBase` is used as a base by other runner builders in FlexUnit4. It provides basic logic for the handling of constructing `IRunner`s for children of a provided test class. These children in turn may have children that will also need corresponding `IRunners`. The `RunnerBuilderBase`contains logic ensuring that a parent class does not reference itself or that a child class does not reference the parent, preventing a potential infinite loop.

See also

org.flexunit.internals.builders.AllDefaultPossibilitiesBuilder

Public Methods

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

Constructor Detail

RunnerBuilderBase | () | Constructor

`public function RunnerBuilderBase()`

Constructor.

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 false, forcing any new subclasses of RunnerBuilderBase to override this method.

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 `IRunner`s, 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 `IRunner`s, one for each child class.

safeRunnerForClass | () | method |

`public function safeRunnerForClass(testClass:Class):IRunner`

Returns an `IRunner` that can safely run the provided `testClass`. If no suitable `IRunner` can be found, a value of `null` is returned.

Parameters

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

Returns

| `IRunner` — an `IRunner` that can run the `testClass`.

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