public class AbstractAnnotationSpec extends AbstractSpec
Spec.DefaultImpls| Constructor and Description |
|---|
AbstractAnnotationSpec(kotlin.jvm.functions.Function1<? super io.kotlintest.specs.AbstractAnnotationSpec,kotlin.Unit> body) |
AbstractAnnotationSpec() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterSpec(Spec spec)
Is invoked after the
class TestCases that are part of a particular
interface Spec instance have completed. |
void |
afterTest(TestCase testCase,
TestResult result)
This callback is invoked after a
class TestCase has finished. |
void |
beforeSpec(Spec spec)
This callback is invoked after the Engine instantiates a
interface Spec
to be used as part of a class TestCase execution. |
void |
beforeTest(TestCase testCase)
This callback will be invoked before a
class TestCase is executed. |
java.util.List<io.kotlintest.TestCase> |
testCases()
These are the top level
class TestCase instances for this Spec. |
addTestCase, autoClose, closeResources, createTestCase, getAcceptingTopLevelRegistration, getDefaultTestCaseConfig, isInstancePerTest, setAcceptingTopLevelRegistration, testCasescloseResources, description, extensions, focused, hasFocusedTest, isInstancePerTest, isolationMode, listeners, tags, testCaseOrder, testCasesafterDiscovery, afterProject, afterSpec, afterSpec, afterSpecClass, afterSpecCompleted, afterTest, afterTest, beforeProject, beforeSpec, beforeSpec, beforeSpecClass, beforeSpecStarted, beforeTest, beforeTestpublic AbstractAnnotationSpec(kotlin.jvm.functions.Function1<? super io.kotlintest.specs.AbstractAnnotationSpec,kotlin.Unit> body)
public AbstractAnnotationSpec()
public void beforeSpec(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 void beforeTest(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 void afterTest(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 void afterSpec(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 java.util.List<io.kotlintest.TestCase> testCases()
These are the top level class TestCase instances for this Spec.
class TestCase