TestPlan describes the tree of tests and containers as discovered
by a Launcher.
Tests and containers are represented by TestIdentifier instances.
The complete set of identifiers comprises a tree-like structure. However,
each identifier only stores the unique ID of its parent. This class provides
a number of helpful methods to retrieve the
parent,
children, and
descendants of an identifier.
While the contained instances of TestIdentifier are immutable,
instances of this class contain mutable state. For example, when a dynamic
test is registered at runtime, it is added to the original test plan and
reported to TestExecutionListener implementations.
This class is not intended to be extended by clients.
Launcher, TestExecutionListener
| Modifier and Type | Class and Description |
|---|---|
| public static interface | TestPlan.
Visitor for |
| Modifier and Type | Field and Description |
|---|---|
| private final Map | |
| private final Map | |
| private final ConfigurationParameters | |
| private final boolean | |
| private final OutputDirectoryCreator | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| protected | TestPlan(boolean containsTests, ConfigurationParameters configurationParameters, OutputDirectoryCreator outputDirectoryCreator)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| public void | |
| public boolean | Returns: true if this test plan contains testsReturn whether this test plan contains any tests. |
| public long | Returns: the number of identifiers that satisfy the supplied predicatea predicate which returns predicate)true for identifiers
to be counted; never nullCount all |
| public static TestPlan | Returns: a new test planwhether the test plan contains tests containsTests, Collection<TestDescriptor> the engine test descriptors from which the test
plan should be created; never engineDescriptors, ConfigurationParameters nullthe configurationParameters, OutputDirectoryCreator ConfigurationParameters for
this test plan; never nullthe outputDirectoryCreator)OutputDirectoryProvider for
this test plan; never nullConstruct a new |
| public Set | Returns: an unmodifiable set of the parent's children, potentially emptythe identifier to look up the children for; never parent)nullGet the children of the supplied |
| public Set | Returns: an unmodifiable set of the parent's children, potentially emptythe unique ID to look up the children for; never
parentId)nullGet the children of the supplied unique ID. |
| public ConfigurationParameters | Returns: the configuration parameters; nevernullGet the |
| public Set | Returns: an unmodifiable set of the parent's descendants, potentially emptythe identifier to look up the descendants for; never parent)nullGet all descendants of the supplied |
| public OutputDirectoryCreator | Returns: the output directory creator; nevernullGet the |
| public OutputDirectoryProvider | Returns: the output directory provider; nevernull
Deprecated
for removal since 1.14. Please use
getOutputDirectoryCreator() instead
Get the
|
| public Optional | Returns: anOptional containing the parent, if presentthe identifier to look up the parent for; never child)nullGet the parent of the supplied |
| public Set | Returns: an unmodifiable set of the root identifiersGet the root |
| public TestIdentifier | Returns: the identifier with the supplied unique ID; nevernullthe unique ID to look up the identifier for; never
uniqueId)null or blank
Deprecated
since 1.10. Use
getTestIdentifier(UniqueId) instead.
Get the |
| public TestIdentifier | Returns: the identifier with the supplied unique ID; nevernullthe unique ID to look up the identifier for; never
uniqueId)nullGet the |
| allIdentifiers | back to summary |
|---|---|
| private final Map<UniqueId, TestIdentifier> allIdentifiers | |
| children | back to summary |
|---|---|
| private final Map<UniqueId, Set<TestIdentifier>> children | |
| configurationParameters | back to summary |
|---|---|
| private final ConfigurationParameters configurationParameters | |
| containsTests | back to summary |
|---|---|
| private final boolean containsTests | |
| outputDirectoryCreator | back to summary |
|---|---|
| private final OutputDirectoryCreator outputDirectoryCreator | |
| roots | back to summary |
|---|---|
| private final Set<TestIdentifier> roots | |
| TestPlan | back to summary |
|---|---|
| protected TestPlan(boolean containsTests, ConfigurationParameters configurationParameters, OutputDirectoryCreator outputDirectoryCreator) | |
| accept | back to summary |
|---|---|
| public void accept(TestPlan. Accept the supplied
| |
| accept | back to summary |
|---|---|
| private void accept(TestPlan. | |
| addInternal | back to summary |
|---|---|
| public void addInternal(TestIdentifier testIdentifier) | |
| containsTests | back to summary |
|---|---|
| public boolean containsTests() Return whether this test plan contains any tests. A test plan contains tests, if at least one of the contained engine descriptors contains tests.
| |
| countTestIdentifiers | back to summary |
|---|---|
| public long countTestIdentifiers(Predicate<? super TestIdentifier> predicate) Count all
| |
| from | back to summary |
|---|---|
| public static TestPlan from(boolean containsTests, Collection<TestDescriptor> engineDescriptors, ConfigurationParameters configurationParameters, OutputDirectoryCreator outputDirectoryCreator) Construct a new Each supplied
| |
| getChildren | back to summary |
|---|---|
| public Set Get the children of the supplied
| |
| getChildren | back to summary |
|---|---|
| public Set Get the children of the supplied unique ID.
| |
| getConfigurationParameters | back to summary |
|---|---|
| public ConfigurationParameters getConfigurationParameters() Get the
| |
| getDescendants | back to summary |
|---|---|
| public Set Get all descendants of the supplied
| |
| getOutputDirectoryCreator | back to summary |
|---|---|
| public OutputDirectoryCreator getOutputDirectoryCreator() Get the
| |
| getOutputDirectoryProvider | back to summary |
|---|---|
| public OutputDirectoryProvider getOutputDirectoryProvider()
Get the
| |
| getParent | back to summary |
|---|---|
| public Optional Get the parent of the supplied
| |
| getRoots | back to summary |
|---|---|
| public Set Get the root
| |
| getTestIdentifier | back to summary |
|---|---|
| public TestIdentifier getTestIdentifier(String uniqueId) throws PreconditionViolationException
Get the
| |
| getTestIdentifier | back to summary |
|---|---|
| public TestIdentifier getTestIdentifier(UniqueId uniqueId) Get the
| |
TestIdentifiers in a TestPlan.
| Modifier and Type | Method and Description |
|---|---|
| public default void | |
| public default void | |
| public default void |
| postVisitContainer | back to summary |
|---|---|
| public default void postVisitContainer(TestIdentifier testIdentifier) Called after visiting a container.
| |
| preVisitContainer | back to summary |
|---|---|
| public default void preVisitContainer(TestIdentifier testIdentifier) Called before visiting a container.
| |
| visit | back to summary |
|---|---|
| public default void visit(TestIdentifier testIdentifier) Called for all test identifiers regardless of their type. | |