| Package | org.flexunit.async |
| Class | public class AsyncLocator |
| Inheritance | AsyncLocator Object |
AsyncLocator is used to keep track of test cases that have implemented asynchronous
functionality. The test cases are registered with the AsyncLocator and reference an
object that implements IAsyncHandlingStatement. Test cases are registered using the
method #registerStatementForTest().
The IAsyncHandlingStatement is then retrieved using the method #getCallableForTest()
and providing the test case. If a test case has not been registered, an AssertionError will be
thrown.
Once an asynchronous test has completed, the method #cleanUpCallableForTest should be called in
order to disassociate the test case and the IAsyncHandlingStatement.
See also
| Method | Defined By | ||
|---|---|---|---|
cleanUpCallableForTest(testCase:Object):void [static]
Removes the registration for the IAsyncHandlingStatement that was associated with the
provided testCase. | AsyncLocator | ||
getCallableForTest(testCase:Object):IAsyncHandlingStatement [static]
Retrieves the IAsyncHandlingStatement for the provided testCase. | AsyncLocator | ||
hasCallableForTest(testCase:Object):Boolean [static] | AsyncLocator | ||
registerStatementForTest(expectAsyncInstance:IAsyncHandlingStatement, testCase:Object):void [static]
Registers the expectAsyncInstance with the provided testCase. | AsyncLocator | ||
| cleanUpCallableForTest | () | method |
public static function cleanUpCallableForTest(testCase:Object):void
Removes the registration for the IAsyncHandlingStatement that was associated with the
provided testCase.
Parameters
testCase:Object — The test case to remove the association with the IAsyncHandlingStatement.
|
| getCallableForTest | () | method |
public static function getCallableForTest(testCase:Object):IAsyncHandlingStatement
Retrieves the IAsyncHandlingStatement for the provided testCase. If no
IAsyncHandlingStatement has been registered for the testCase, an
AssertionError will be thrown.
Parameters
testCase:Object — The test case used to retrieve the IAsyncHandlingStatement.
|
IAsyncHandlingStatement — an IAsyncHandlingStatement associated with the testCase.
|
AssertionError — Thrown if an IAsyncHandlingStatement was not registered
for the provided testCase.
|
| hasCallableForTest | () | method |
public static function hasCallableForTest(testCase:Object):BooleanParameters
testCase:Object |
Boolean |
| registerStatementForTest | () | method |
public static function registerStatementForTest(expectAsyncInstance:IAsyncHandlingStatement, testCase:Object):void
Registers the expectAsyncInstance with the provided testCase.
Parameters
expectAsyncInstance:IAsyncHandlingStatement — the IAsyncHandlingStatement to be registered.
| |
testCase:Object — The test case to associate with the particular expectAsyncInstance.
|