public TestEngineListener
Implementations of this interface will be notified of events
that occur as part of the class TestEngine lifecycle.
This is an internal listener liable to be changed.
class TestEngine| Modifier and Type | Interface and Description |
|---|---|
static class |
TestEngineListener.DefaultImpls
Implementations of this interface will be notified of events
that occur as part of the
class TestEngine lifecycle. |
| Modifier and Type | Method and Description |
|---|---|
void |
afterSpecClass(kotlin.reflect.KClass<? extends io.kotlintest.Spec> klass,
java.lang.Throwable t)
Is invoked once per Spec to indicate that all TestCase instances
of the spec have returned and the SpecRunner has completed.
|
void |
afterTestCaseExecution(io.kotlintest.TestCase testCase,
io.kotlintest.TestResult result)
Invoked when all the invocations of a TestCase have completed.
This function will only be invoked if a test case was active.
The result passed in here is the result directly from the test run, before any interception.
|
void |
beforeSpecClass(kotlin.reflect.KClass<? extends io.kotlintest.Spec> klass)
Is invoked once per Spec when the
class TestEngine is preparing
to submit the spec for execution to a SpecRunner. |
void |
beforeTestCaseExecution(io.kotlintest.TestCase testCase)
Invoked if a TestCase will be executed (is active).
|
void |
engineFinished(java.lang.Throwable t)
Is invoked when the
class TestEngine has finished execution. |
void |
engineStarted(java.util.List<? extends kotlin.reflect.KClass<? extends io.kotlintest.Spec>> classes)
Is invoked when the
class TestEngine is starting execution. |
void |
enterTestCase(io.kotlintest.TestCase testCase)
Invoked each time a TestCase has been entered from a parent test.
|
void |
exitTestCase(io.kotlintest.TestCase testCase,
io.kotlintest.TestResult result)
Executed each time a TestCase has completed.
|
void |
invokingTestCase(io.kotlintest.TestCase testCase,
int k)
Invoked each time a TestCase is about to be executed with a unique
ordinal for each execution.
|
void |
specCreated(io.kotlintest.Spec spec)
Invoked each time an instance of a Spec is created.
A spec may be created once per class, or one per TestCase.
|
void |
specInitialisationFailed(kotlin.reflect.KClass<? extends io.kotlintest.Spec> klass,
java.lang.Throwable t)
Is invoked if a Spec throws an exception during initialisation
|
void engineStarted(java.util.List<? extends kotlin.reflect.KClass<? extends io.kotlintest.Spec>> classes)
Is invoked when the class TestEngine is starting execution.
classes - the Spec classes that will be used by the class TestEngine.class TestEnginevoid engineFinished(java.lang.Throwable t)
Is invoked when the class TestEngine has finished execution.
If an unrecoverable error was detected during execution then it will be passed as the parameter to the engine.
class TestEnginevoid beforeSpecClass(kotlin.reflect.KClass<? extends io.kotlintest.Spec> klass)
Is invoked once per Spec when the class TestEngine is preparing
to submit the spec for execution to a SpecRunner.
class TestEngine,
SpecRunnervoid afterSpecClass(kotlin.reflect.KClass<? extends io.kotlintest.Spec> klass,
java.lang.Throwable t)
Is invoked once per Spec to indicate that all TestCase instances of the spec have returned and the SpecRunner has completed.
void specInitialisationFailed(kotlin.reflect.KClass<? extends io.kotlintest.Spec> klass,
java.lang.Throwable t)
Is invoked if a Spec throws an exception during initialisation
void enterTestCase(io.kotlintest.TestCase testCase)
Invoked each time a TestCase has been entered from a parent test.
If a parent test has been configured with multiple invocations, then this function will be executed once per parent invocation.
void exitTestCase(io.kotlintest.TestCase testCase,
io.kotlintest.TestResult result)
Executed each time a TestCase has completed.
This function will always be executed even if the test case is skipped. The result passed in here will be after test case interception.
If a parent test case has been configured with multiple invocations, then this function will be executed once per parent invocation.
void beforeTestCaseExecution(io.kotlintest.TestCase testCase)
Invoked if a TestCase will be executed (is active).
void invokingTestCase(io.kotlintest.TestCase testCase,
int k)
Invoked each time a TestCase is about to be executed with a unique ordinal for each execution.
If a test case is configured with invocations = k, then this function will be invoked k times.
k - indicates the execution number - if a test is configured with threads > 1, then it is
not guaranteed (and very unlikely) that k will be ordered.void afterTestCaseExecution(io.kotlintest.TestCase testCase,
io.kotlintest.TestResult result)
Invoked when all the invocations of a TestCase have completed. This function will only be invoked if a test case was active. The result passed in here is the result directly from the test run, before any interception.
void specCreated(io.kotlintest.Spec spec)
Invoked each time an instance of a Spec is created. A spec may be created once per class, or one per TestCase.