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

Package | org.flexunit.runner.notification
Class | public class RunNotifier
Inheritance | RunNotifier Object
Implements | IRunNotifier

The `RunNotifier` is a class that FlexUnit4 uses to notify registered `IRunListeners` of an event that occurred during testing. There is generally only one `RunNotifier` used in a test run at a time. `RunNotifier` is used by the `IRunner` classes to notify others of the following conditions:

- For the Test Run: Started/Finished
- For an Individual Test: Started/Failed/Ignored/Finished/AssumptionFailures

Each `IRunListener` that is to be registered or unregistered to the `RunNotifier` needs to call either the `#addRunListener()` or the `#removeRunListener()` method. When the `RunNotifier` encounters one of the conditions stated above, all registered `IRunListeners` will be notified. If one writes an `IRunner`, they may need to notify FlexUnit4 of their progress while running tests. This is accomplished by invoking the `IRunNotifier` passed to the implementation of `org.flexunit.runner.IRunner#run(RunNotifier)`.

See also

org.flexunit.runner.IRunner.run()
org.flexunit.runner.notification.IRunListener

Public Methods

| Method | Defined By
--- | --- | ---
|  | RunNotifier() Constructor. | RunNotifier
|  | addFirstListener(listener:IRunListener):void Internal use only. | RunNotifier
|  | addListener(listener:IRunListener):void Internal use only. | RunNotifier
|  | fireTestAssumptionFailed(failure:Failure):void Invoke to tell listeners that an atomic test flagged that it assumed something false. | RunNotifier
|  | fireTestFailure(failure:Failure):void Invoke to tell listeners that an atomic test failed. | RunNotifier
|  | fireTestFinished(description:IDescription):void Invoke to tell listeners that an atomic test finished. | RunNotifier
|  | fireTestIgnored(description:IDescription):void Invoke to tell listeners that an atomic test was ignored. | RunNotifier
|  | fireTestRunFinished(result:Result):void Do not invoke. | RunNotifier
|  | fireTestRunStarted(description:IDescription):void Do not invoke. | RunNotifier
|  | fireTestStarted(description:IDescription):void Invoke to tell listeners that an atomic test is about to start. | RunNotifier
|  | removeAllListeners():void | RunNotifier
|  | removeListener(listener:IRunListener):void Internal use only. | RunNotifier

Constructor Detail

RunNotifier | () | Constructor

`public function RunNotifier()`

Constructor.

Method Detail

addFirstListener | () | method

`public function addFirstListener(listener:IRunListener):void`

Internal use only. The Result's listener must be first.

Parameters

| `listener:IRunListener`

addListener | () | method |

`public function addListener(listener:IRunListener):void`

Internal use only.

Parameters

| `listener:IRunListener`

fireTestAssumptionFailed | () | method |

`public function fireTestAssumptionFailed(failure:Failure):void`

Invoke to tell listeners that an atomic test flagged that it assumed something false.

Parameters

| `failure:Failure` — The description of the test that failed and the `AssumptionViolatedException` thrown.

fireTestFailure | () | method |

`public function fireTestFailure(failure:Failure):void`

Invoke to tell listeners that an atomic test failed.

Parameters

| `failure:Failure` — The description of the test that failed and the exception thrown.

fireTestFinished | () | method |

`public function fireTestFinished(description:IDescription):void`

Invoke to tell listeners that an atomic test finished. Always invoke `#fireTestFinished(IDescription)` if you invoke `#fireTestStarted(Description)` as listeners are likely to expect them to come in pairs.

Parameters

| `description:IDescription` — The description of the test that finished.

See also

fireTestStarted()

fireTestIgnored | () | method |

`public function fireTestIgnored(description:IDescription):void`

Invoke to tell listeners that an atomic test was ignored.

Parameters

| `description:IDescription` — The description of the ignored test.

fireTestRunFinished | () | method |

`public function fireTestRunFinished(result:Result):void`

Do not invoke.

Parameters

| `result:Result`

fireTestRunStarted | () | method |

`public function fireTestRunStarted(description:IDescription):void`

Do not invoke.

Parameters

| `description:IDescription`

fireTestStarted | () | method |

`public function fireTestStarted(description:IDescription):void`

Invoke to tell listeners that an atomic test is about to start.

Parameters

| `description:IDescription` — The description of the atomic test (generally a class and method name).

Throws

| `StoppedByUserException` — Thrown if a user has requested that the test run stop.

removeAllListeners | () | method |

`public function removeAllListeners():void`

removeListener | () | method |

`public function removeListener(listener:IRunListener):void`

Internal use only.

Parameters

| `listener:IRunListener`

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