Package org.junit.platform.launcher.core
Class InternalTestPlan
- java.lang.Object
-
- org.junit.platform.launcher.TestPlan
-
- org.junit.platform.launcher.core.InternalTestPlan
-
class InternalTestPlan extends TestPlan
- Since:
- 1.4
-
-
Constructor Summary
Constructors Modifier Constructor Description private
InternalTestPlan(Root root, TestPlan delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(TestIdentifier testIdentifier)
Add the suppliedTestIdentifier
to this test plan.(package private) void
addInternal(TestIdentifier testIdentifier)
boolean
containsTests()
Return whether this test plan contains any tests.long
countTestIdentifiers(java.util.function.Predicate<? super TestIdentifier> predicate)
Count allTestIdentifiers
that satisfy the given predicate.(package private) static InternalTestPlan
from(Root root)
java.util.Set<TestIdentifier>
getChildren(java.lang.String parentId)
Get the children of the supplied unique ID.java.util.Set<TestIdentifier>
getChildren(TestIdentifier parent)
Get the children of the suppliedTestIdentifier
.(package private) TestPlan
getDelegate()
java.util.Set<TestIdentifier>
getDescendants(TestIdentifier parent)
Get all descendants of the suppliedTestIdentifier
(i.e., all of its children and their children, recursively).java.util.Optional<TestIdentifier>
getParent(TestIdentifier child)
Get the parent of the suppliedTestIdentifier
.(package private) Root
getRoot()
java.util.Set<TestIdentifier>
getRoots()
Get the rootTestIdentifiers
for this test plan.TestIdentifier
getTestIdentifier(java.lang.String uniqueId)
Get theTestIdentifier
with the supplied unique ID.
-
-
-
Method Detail
-
from
static InternalTestPlan from(Root root)
-
getRoot
Root getRoot()
-
getDelegate
TestPlan getDelegate()
-
add
public void add(TestIdentifier testIdentifier)
Description copied from class:TestPlan
Add the suppliedTestIdentifier
to this test plan.
-
addInternal
void addInternal(TestIdentifier testIdentifier)
-
getRoots
public java.util.Set<TestIdentifier> getRoots()
Description copied from class:TestPlan
Get the rootTestIdentifiers
for this test plan.
-
getParent
public java.util.Optional<TestIdentifier> getParent(TestIdentifier child)
Description copied from class:TestPlan
Get the parent of the suppliedTestIdentifier
.
-
getChildren
public java.util.Set<TestIdentifier> getChildren(TestIdentifier parent)
Description copied from class:TestPlan
Get the children of the suppliedTestIdentifier
.- Overrides:
getChildren
in classTestPlan
- Parameters:
parent
- the identifier to look up the children for; nevernull
- Returns:
- an unmodifiable set of the parent's children, potentially empty
- See Also:
TestPlan.getChildren(String)
-
getChildren
public java.util.Set<TestIdentifier> getChildren(java.lang.String parentId)
Description copied from class:TestPlan
Get the children of the supplied unique ID.- Overrides:
getChildren
in classTestPlan
- Parameters:
parentId
- the unique ID to look up the children for; nevernull
or blank- Returns:
- an unmodifiable set of the parent's children, potentially empty
- See Also:
TestPlan.getChildren(TestIdentifier)
-
getTestIdentifier
public TestIdentifier getTestIdentifier(java.lang.String uniqueId) throws PreconditionViolationException
Description copied from class:TestPlan
Get theTestIdentifier
with the supplied unique ID.- Overrides:
getTestIdentifier
in classTestPlan
- Parameters:
uniqueId
- the unique ID to look up the identifier for; nevernull
or blank- Returns:
- the identifier with the supplied unique ID; never
null
- Throws:
PreconditionViolationException
- if noTestIdentifier
with the supplied unique ID is present in this test plan
-
countTestIdentifiers
public long countTestIdentifiers(java.util.function.Predicate<? super TestIdentifier> predicate)
Description copied from class:TestPlan
Count allTestIdentifiers
that satisfy the given predicate.- Overrides:
countTestIdentifiers
in classTestPlan
- Parameters:
predicate
- a predicate which returnstrue
for identifiers to be counted; nevernull
- Returns:
- the number of identifiers that satisfy the supplied predicate
-
getDescendants
public java.util.Set<TestIdentifier> getDescendants(TestIdentifier parent)
Description copied from class:TestPlan
Get all descendants of the suppliedTestIdentifier
(i.e., all of its children and their children, recursively).- Overrides:
getDescendants
in classTestPlan
- Parameters:
parent
- the identifier to look up the descendants for; nevernull
- Returns:
- an unmodifiable set of the parent's descendants, potentially empty
-
containsTests
public boolean containsTests()
Description copied from class:TestPlan
Return whether this test plan contains any tests.A test plan contains tests, if at least one of the contained engine descriptors contains tests.
- Overrides:
containsTests
in classTestPlan
- Returns:
true
if this test plan contains tests- See Also:
TestDescriptor.containsTests(TestDescriptor)
-
-