public final class TestCuppaSupport
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static TestBlock |
defineTests(java.lang.Runnable testDefiner)
Define some Cuppa tests.
|
static Hook |
findHook(TestBlock testBlock,
java.lang.String description)
Finds the first hook with the given description.
|
static Test |
findTest(TestBlock testBlock,
java.lang.String description)
Finds the first test with the given description.
|
static TestBlock |
findTestBlock(TestBlock testBlock,
java.lang.String description)
Finds the first test block with the given description.
|
static void |
runTests(TestBlock testBlock,
Reporter reporter)
Helper method to simplify running tests.
|
static void |
runTests(TestBlock testBlock,
Reporter reporter,
Tags tags)
Helper method to simplify running tests.
|
public static TestBlock defineTests(java.lang.Runnable testDefiner)
testDefiner
- A function which will call Cuppa
methods to define tests.public static void runTests(TestBlock testBlock, Reporter reporter)
testBlock
- The root test block that contains all tests to be run.reporter
- The reporter to use to report test results.public static void runTests(TestBlock testBlock, Reporter reporter, Tags tags)
testBlock
- The root test block that contains all tests to be run.reporter
- The reporter to use to report test results.tags
- Tags to filter the tests on.public static Test findTest(TestBlock testBlock, java.lang.String description)
testBlock
- the root test block to search under.description
- The description.java.util.NoSuchElementException
- If no test was found with the given description.public static TestBlock findTestBlock(TestBlock testBlock, java.lang.String description)
testBlock
- the root test block to search under.description
- The description.java.util.NoSuchElementException
- If no test block was found with the given description.public static Hook findHook(TestBlock testBlock, java.lang.String description)
Hooks are searched breadth-first, i.e. going through a test block's before, after, beforeEach and afterEach hooks before searching in nested test blocks.
testBlock
- the root test block to search under.description
- The description.java.util.NoSuchElementException
- If no hook was found with the given description.