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

Package | org.flexunit.runner
Class | public class Request
Inheritance | Request Object
Implements | IRequest
Subclasses | ClassRequest, FilterRequest, QualifyingRequest, SortingRequest

A `Request` is an abstract description of tests to be run. It represents an object that wraps tests when they are presented to the `FlexUnitCore`. `Request`s can be filtered and sorted to control the subset and order of tests to be executed. The following static methods can be used to create requests:

- `#aClass()`
- `#classes()`
- `#runner()`
- `#method()`

The key property of the `Request` that the `FlexUnitCore` needs is the `IRunner`. The `IRunner` is an interface implemented by any object capable of executing a specific type of test.

The flow when FlexUnit4 runs tests is that a `Request` specifies some tests to be run. The `IRunner` is created for each class implied by the `Request`. The `IRunner` provides a detailed `IDescription` of the class which is a tree structure of the tests to be run.

Public Properties

| Property | Defined By
--- | --- | ---
|  | iRunner : IRunner [read-only] Returns an IRunner for this Request. | Request
|  | sort : ISort Returns an ISort for this Request. | Request

Public Methods

| Method | Defined By
--- | --- | ---
|  | Request() Constructor. | Request
|  | aClass(clazz:Class):Request [static] Create a Request that, when processed, will run all the tests in a class. | Request
|  | classes(... argumentsArray):Request [static] Create a Request that, when processed, will run all the tests in a set of classes. | Request
|  | filterWith(filterOrDescription:*):Request Returns a Request that either filters based on a Description or a Filter. | Request
|  | getRunner():IRunner Deprecated: Use the iRunner property instead | Request
|  | method(clazz:Class, methodName:String):Request [static] Create a Request that, when processed, will run a single test. | Request
|  | methods(clazz:Class, methodNames:Array):Request [static] | Request
|  | qualifyClasses(... argumentsArray):Request [static] | Request
|  | runner(runner:IRunner):Request [static] | Request
|  | sortWith(sorterOrComparatorFunction:*):Request | Request

Protected Methods

| Method | Defined By
--- | --- | ---
|  | filterWithDescription(desiredDescription:IDescription):Request Returns a Request that only runs contains tests whose Description equals desiredDescription. | Request
|  | filterWithFilter(filter:IFilter):Request Returns a Request that only contains those tests that should run when a filter is applied. | Request

Property Detail

_runner | property

`classInternal var _runner:IRunner`

The `IRunner` for this Request.

iRunner | property |

`iRunner:IRunner` [read-only]

Returns an `IRunner` for this Request.

Implementation
`public function get iRunner():IRunner`

sort | property |

`sort:ISort`

Returns an `ISort` for this Request.

Implementation
`public function get sort():ISort`
`public function set sort(value:ISort):void`
Constructor Detail

Request | () | Constructor

`public function Request()`

Constructor.

Method Detail

aClass | () | method

`public static function aClass(clazz:Class):Request`

Create a `Request` that, when processed, will run all the tests in a class. The odd name is necessary because `class` is a reserved word.

Parameters

| `clazz:Class` — the class containing the tests.

Returns

| `Request` — a `Request` that will cause all tests in the class to be run.

classes | () | method |

`public static function classes(... argumentsArray):Request`

Create a `Request` that, when processed, will run all the tests in a set of classes.

Parameters

| `... argumentsArray` — the classes containing the tests.

Returns

| `Request` — a `Request` that will cause all tests in the classes to be run.

filterWith | () | method |

`public function filterWith(filterOrDescription:*):Request`

Returns a Request that either filters based on a `Description` or a `Filter`.

Parameters

| `filterOrDescription:*` — The `Filter` or `Description` to apply to this Request.

Returns

| `Request` — the filtered Request.

filterWithDescription | () | method |

`protected function filterWithDescription(desiredDescription:IDescription):Request`

Returns a Request that only runs contains tests whose `Description` equals `desiredDescription`.

Parameters

| `desiredDescription:IDescription` — An `IDescription` of those tests that should be run.

Returns

| `Request` — the filtered Request.

filterWithFilter | () | method |

`protected function filterWithFilter(filter:IFilter):Request`

Returns a Request that only contains those tests that should run when a `filter` is applied.

Parameters

| `filter:IFilter` — The `Filter` to apply to this Request.

Returns

| `Request` — the filtered Request.

getRunner | () | method |

`public function getRunner():IRunner`
Deprecated: Use the iRunner property instead

Returns

| `IRunner`

method | () | method |

`public static function method(clazz:Class, methodName:String):Request`

Create a `Request` that, when processed, will run a single test. This is done by filtering out all other tests. This method is used to support rerunning single tests.

Parameters

| `clazz:Class` — the class of the test.
| `methodName:String` — the name of the test.

Returns

| `Request` — a `Request` that will cause a single test be run.

methods | () | method |

`public static function methods(clazz:Class, methodNames:Array):Request`

Parameters

| `clazz:Class`
| `methodNames:Array`

Returns

| `Request`

qualifyClasses | () | method |

`public static function qualifyClasses(... argumentsArray):Request`

Parameters

| `... argumentsArray`

Returns

| `Request`

runner | () | method |

`public static function runner(runner:IRunner):Request`

Parameters

| `runner:IRunner` — the IRunner to return.

Returns

| `Request` — a `Request` that will run the given runner when invoked.

sortWith | () | method |

`public function sortWith(sorterOrComparatorFunction:*):Request`

Parameters

| `sorterOrComparatorFunction:*` — is either an ISorted implementation or a comparator function to be used to define the sort order of the tests in this Request.

Returns

| `Request` — a Request with ordered Tests.

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