Async test executor.


  • testing asynchronous multithread code
  • running test functions concurrently or sequentialy, see concurrent() annotation and herd.asynctest
  • multi-reporting: several failures or successes can be reported for a one test execution, each report is represented as test variant and might be marked with String title
  • value- and type- parameterized testing with a set of function arguments, see herd.asynctest.parameterization for details
  • conditional execution with annotations satisfied ceylon.test.engine.spi::TestCondition interface

In order to utilize this executor capabilities test function has to accept AsyncTestContext as the first argument:

    test async
    void doTesting(AsyncTestContext context) {...}   


To run the test using this executor apply async() annotation at function, class, package or module level (alternatively, ceylon.test::testExecutor annotation with `class AsyncTestExecutor` argument is to be applied).
Following procedure is as usual for SDK ceylon.test module - mark tested functions with ceylon.test::test annotation and run test in IDE or command line.

Test logic

When test function taking AsyncTestContext as first argument is executed it is expected the function will do following steps:

  1. Performing the test, reporting on failures via AsyncTestContext. Several error or success reports are allowed. Each failure or success report is represented as test variant.
  2. Notifying test executor on test procedure completion - AsyncTestContext.complete(). This step is nesseccary to continue testing with next execution since test executor blocks execution thread until AsyncTestContext.complete() is called.

By: Lis
See also testExecutor, async(), AsyncTestContext
Since 0.0.1

no subtypes hierarchy

AsyncTestExecutor(FunctionDeclaration functionDeclaration, ClassDeclaration? classDeclaration)
descriptionshared actual TestDescription description

The description of the test to be run.

Refines TestExecutor.description
stringshared actual String string

A developer-friendly string representing the instance. Concatenates the name of the concrete class of the instance with the hash of the instance. Subclasses are encouraged to refine this implementation to produce a more meaningful representation.

Refines Object.string
Inherited Attributes
Attributes inherited from: Object
hash, string
Attributes inherited from: TestExecutor
executeshared actual void execute(TestExecutionContext parent)

Run the test.

Refines TestExecutor.execute
Inherited Methods
Methods inherited from: Object
Methods inherited from: TestExecutor