public static class TestListener.DefaultImpls
| Modifier and Type | Method and Description |
|---|---|
static void |
afterDiscovery(TestListener $this,
java.util.List<io.kotlintest.Description> descriptions)
Is invoked after all the
interface Spec classes have been discovered.
This callback will be called after any interface DiscoveryExtensions have been invoked. |
static void |
afterProject(TestListener $this)
Is invoked once the Test Engine has finished.
|
static void |
afterSpec(TestListener $this,
Spec spec)
Is invoked after the
class TestCases that are part of a particular
interface Spec instance have completed. |
static void |
afterSpec(TestListener $this,
Description description,
Spec spec)
Deprecated.
|
static void |
afterSpecClass(TestListener $this,
Spec spec,
java.util.Map<io.kotlintest.TestCase,io.kotlintest.TestResult> results)
Called once per
interface Spec, after all tests have completed for that spec. |
static void |
afterSpecCompleted(TestListener $this,
Description description,
Spec spec)
Deprecated.
|
static void |
afterTest(TestListener $this,
TestCase testCase,
TestResult result)
This callback is invoked after a
class TestCase has finished. |
static void |
afterTest(TestListener $this,
Description description,
TestResult result)
Deprecated.
|
static void |
beforeProject(TestListener $this)
Is invoked once the Test Engine is started.
|
static void |
beforeSpec(TestListener $this,
Spec spec)
This callback is invoked after the Engine instantiates a
interface Spec
to be used as part of a class TestCase execution. |
static void |
beforeSpec(TestListener $this,
Description description,
Spec spec)
Deprecated.
|
static void |
beforeSpecClass(TestListener $this,
Spec spec,
java.util.List<io.kotlintest.extensions.TopLevelTest> tests)
Called once per
interface Spec, when the engine is preparing to
execute the tests for that spec. |
static void |
beforeSpecStarted(TestListener $this,
Description description,
Spec spec)
Deprecated.
|
static void |
beforeTest(TestListener $this,
TestCase testCase)
This callback will be invoked before a
class TestCase is executed. |
static void |
beforeTest(TestListener $this,
Description description)
Deprecated.
|
public static void beforeProject(TestListener $this)
Is invoked once the Test Engine is started.
public static void afterProject(TestListener $this)
Is invoked once the Test Engine has finished.
public static void beforeTest(TestListener $this, TestCase testCase)
This callback will be invoked before a class TestCase is executed.
If a test case is inactive (disabled), then this method will not be invoked for that particular test case.
testCase - the class TestCase about to be executed.class TestCasepublic static void afterTest(TestListener $this, TestCase testCase, TestResult result)
This callback is invoked after a class TestCase has finished.
If a test case was skipped (ignored / disabled / inactive) then this callback will not be invoked for that particular test case.
testCase - the class TestCase that has completed.class TestCasepublic static void beforeSpec(TestListener $this, Spec spec)
This callback is invoked after the Engine instantiates a interface Spec
to be used as part of a class TestCase execution.
If a spec is instantiated multiple times - for example, if InstancePerTest or InstancePerLeaf isolation modes are used, then this callback will be invoked for each instance created, just before the first test (or only test) is executed for that spec.
This callback should be used if you need to perform setup
each time a new spec instance is created. If you simply need to
perform setup once per class file, then use TestListener.beforeSpecClass.
spec - the interface Spec instance.interface Spec,
class TestCase,
TestListener.beforeSpecClasspublic static void afterSpec(TestListener $this, Spec spec)
Is invoked after the class TestCases that are part of a particular
interface Spec instance have completed.
If a spec is instantiated multiple times - for example, if InstancePerTest or InstancePerLeaf isolation modes are used, then this callback will be invoked for each instantiated spec, after the tests that are applicable to that spec instance have returned.
This callback should be used if you need to perform cleanup
after each individual spec instance. If you simply need to
perform cleanup once per class file, then use TestListener.afterSpecClass.
spec - the interface Spec instance.class TestCase,
interface Spec,
TestListener.afterSpecClasspublic static void beforeSpecClass(TestListener $this, Spec spec, java.util.List<io.kotlintest.extensions.TopLevelTest> tests)
Called once per interface Spec, when the engine is preparing to
execute the tests for that spec.
Regardless of how many times the spec is instantiated, for example, if InstancePerTest or InstancePerLeaf isolation modes are used, this callback will only be invoked once, with the first instance of the Spec.
The top level tests declared in the spec are supplied as a list of
instances of class TopLevelTest which includes a flag set to true if
the test is active or false if inactive.
If there are no active tests in a spec, then this callback will still be invoked.
The order of the list of tests is the same as the order of execution.
spec - the interface Spec instancetests - the list of top level testsinterface Spec,
class TopLevelTestpublic static void afterSpecClass(TestListener $this, Spec spec, java.util.Map<io.kotlintest.TestCase,io.kotlintest.TestResult> results)
Called once per interface Spec, after all tests have completed for that spec.
Regardless of how many times the spec is instantiated, for example, if InstancePerTest or InstancePerLeaf isolation modes are used, this callback will only be invoked once, with the first instance of the Spec.
The results parameter contains every class TestCase, along with
the result of that test, including tests that were ignored (which
will have a TestResult that has TestStatus.Ignored)
spec - the interface Spec instanceresults - a map of each test case mapped to its result.interface Spec,
class TestCasepublic static void afterDiscovery(TestListener $this, java.util.List<io.kotlintest.Description> descriptions)
Is invoked after all the interface Spec classes have been discovered.
This callback will be called after any interface DiscoveryExtensions have been invoked.
In other words the descriptions given here are after discovery extensions have had the chance to filter.
descriptions - the class Description instance for each Spec class discovered.interface Spec,
interface DiscoveryExtensionpublic static void beforeSpec(TestListener $this, Description description, Spec spec)
Is invoked each time a interface Spec is started.
Note: If the spec is running with one instance per test, then this function will be invoked multiple times.
description - the class Description for the root class TestCase of the spec.spec - the actual interface Spec instance.interface Specpublic static void afterSpec(TestListener $this, Description description, Spec spec)
Is invoked each time a interface Spec completes.
Note: If the spec is running with one instance per test, then this function will be invoked multiple times.
description - the class Description for the root class TestCase of the spec.spec - the actual interface Spec instance.interface Specpublic static void beforeTest(TestListener $this, Description description)
This function will be invoked each time a new class TestCase is executed.
description - the class Description for the class TestCase instance.class TestCasepublic static void afterTest(TestListener $this, Description description, TestResult result)
Is invoked when a class TestCase has finished. This includes when a test case
is ignored (skipped), passes (is successful), or fails (errors).
description - the class Description for the class TestCase instance.result - the class TestResult which contains the outcome of the test.class TestCasepublic static void beforeSpecStarted(TestListener $this, Description description, Spec spec)
public static void afterSpecCompleted(TestListener $this, Description description, Spec spec)