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
-
-
Field Summary
Fields Modifier and Type Field Description private TestPlandelegateprivate LauncherDiscoveryResultdiscoveryResultprivate java.util.concurrent.atomic.AtomicBooleanexecutionStartedprivate static Loggerloggerprivate java.util.concurrent.atomic.AtomicBooleanwarningEmitted
-
Constructor Summary
Constructors Modifier Constructor Description privateInternalTestPlan(LauncherDiscoveryResult discoveryResult, TestPlan delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(TestIdentifier testIdentifier)Add the suppliedTestIdentifierto this test plan.(package private) voidaddInternal(TestIdentifier testIdentifier)booleancontainsTests()Return whether this test plan contains any tests.longcountTestIdentifiers(java.util.function.Predicate<? super TestIdentifier> predicate)Count allTestIdentifiersthat satisfy the given predicate.(package private) static InternalTestPlanfrom(LauncherDiscoveryResult discoveryResult)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.java.util.Set<TestIdentifier>getDescendants(TestIdentifier parent)Get all descendants of the suppliedTestIdentifier(i.e., all of its children and their children, recursively).(package private) LauncherDiscoveryResultgetDiscoveryResult()java.util.Optional<TestIdentifier>getParent(TestIdentifier child)Get the parent of the suppliedTestIdentifier.java.util.Set<TestIdentifier>getRoots()Get the rootTestIdentifiersfor this test plan.TestIdentifiergetTestIdentifier(java.lang.String uniqueId)Get theTestIdentifierwith the supplied unique ID.(package private) voidmarkStarted()
-
-
-
Field Detail
-
logger
private static final Logger logger
-
executionStarted
private final java.util.concurrent.atomic.AtomicBoolean executionStarted
-
warningEmitted
private final java.util.concurrent.atomic.AtomicBoolean warningEmitted
-
discoveryResult
private final LauncherDiscoveryResult discoveryResult
-
delegate
private final TestPlan delegate
-
-
Constructor Detail
-
InternalTestPlan
private InternalTestPlan(LauncherDiscoveryResult discoveryResult, TestPlan delegate)
-
-
Method Detail
-
from
static InternalTestPlan from(LauncherDiscoveryResult discoveryResult)
-
markStarted
void markStarted()
-
getDiscoveryResult
LauncherDiscoveryResult getDiscoveryResult()
-
add
public void add(TestIdentifier testIdentifier)
Description copied from class:TestPlanAdd the suppliedTestIdentifierto this test plan.
-
addInternal
void addInternal(TestIdentifier testIdentifier)
-
getRoots
public java.util.Set<TestIdentifier> getRoots()
Description copied from class:TestPlanGet the rootTestIdentifiersfor this test plan.
-
getParent
public java.util.Optional<TestIdentifier> getParent(TestIdentifier child)
Description copied from class:TestPlanGet the parent of the suppliedTestIdentifier.
-
getChildren
public java.util.Set<TestIdentifier> getChildren(TestIdentifier parent)
Description copied from class:TestPlanGet the children of the suppliedTestIdentifier.- Overrides:
getChildrenin 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:TestPlanGet the children of the supplied unique ID.- Overrides:
getChildrenin classTestPlan- Parameters:
parentId- the unique ID to look up the children for; nevernullor 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:TestPlanGet theTestIdentifierwith the supplied unique ID.- Overrides:
getTestIdentifierin classTestPlan- Parameters:
uniqueId- the unique ID to look up the identifier for; nevernullor blank- Returns:
- the identifier with the supplied unique ID; never
null - Throws:
PreconditionViolationException- if noTestIdentifierwith 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:TestPlanCount allTestIdentifiersthat satisfy the given predicate.- Overrides:
countTestIdentifiersin classTestPlan- Parameters:
predicate- a predicate which returnstruefor 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:TestPlanGet all descendants of the suppliedTestIdentifier(i.e., all of its children and their children, recursively).- Overrides:
getDescendantsin 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:TestPlanReturn whether this test plan contains any tests.A test plan contains tests, if at least one of the contained engine descriptors contains tests.
- Overrides:
containsTestsin classTestPlan- Returns:
trueif this test plan contains tests- See Also:
TestDescriptor.containsTests(TestDescriptor)
-
-