Top Description Inners Fields Constructors Methods
org.junit.platform.suite.engine

pack-priv final Class SuiteTestDescriptor

extends AbstractTestDescriptor
Class Inheritance
Static Imports
java.util.Objects.requireNonNull, java.util.function.Predicate.isEqual, java.util.stream.Collectors.joining, org.junit.platform.commons.support.AnnotationSupport.findAnnotation, org.junit.platform.commons.util.FunctionUtils.where, org.junit.platform.suite.engine.SuiteLauncherDiscoveryRequestBuilder.request

TestDescriptor for tests based on the JUnit Platform Suite API.

Default Display Names

The default display name is the simple name of the class.

Since
1.8
See Also
SuiteDisplayName

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
private static class

Field Summary

Modifier and TypeField and Description
private final ConfigurationParameters
private final SuiteLauncherDiscoveryRequestBuilder
private final Boolean
private @Nullable SuiteLauncher
private @Nullable LauncherDiscoveryResult
private final SuiteTestDescriptor.LifecycleMethods
private final OutputDirectoryCreator
pack-priv static final String
private final Class<?>
Inherited from org.junit.platform.engine.support.descriptor.AbstractTestDescriptor:
children

Constructor Summary

AccessConstructor and Description
pack-priv
SuiteTestDescriptor(UniqueId id, Class<?> suiteClass, ConfigurationParameters configurationParameters, OutputDirectoryCreator outputDirectoryCreator, EngineDiscoveryListener discoveryListener, DiscoveryIssueReporter issueReporter)

Method Summary

Modifier and TypeMethod and Description
pack-priv SuiteTestDescriptor
pack-priv SuiteTestDescriptor
private TestExecutionResult
pack-priv void
pack-priv void
execute(EngineExecutionListener executionListener, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken)

private void
private void
private @Nullable TestExecutionSummary
executeTests(EngineExecutionListener executionListener, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken, ThrowableCollector throwableCollector)

private static Boolean
getFailIfNoTests(Class<?> suiteClass)

private static String
getSuiteDisplayName(Class<?> suiteClass, DiscoveryIssueReporter issueReporter)

public TestDescriptor.Type
getType()

Implements org.junit.platform.engine.TestDescriptor.getType.

Determine the Type of this descriptor.

public boolean
mayRegisterTests()

Overrides default org.junit.platform.engine.TestDescriptor.mayRegisterTests.

Determine if this descriptor may register dynamic tests during execution.

Inherited from org.junit.platform.engine.support.descriptor.AbstractTestDescriptor:
addChildequalsfindByUniqueIdgetChildrengetDisplayNamegetParentgetSourcegetTagsgetUniqueIdhashCodeorderChildrenremoveChildremoveFromHierarchysetParenttoString

Field Detail

configurationParametersback to summary
private final ConfigurationParameters configurationParameters
discoveryRequestBuilderback to summary
private final SuiteLauncherDiscoveryRequestBuilder discoveryRequestBuilder
failIfNoTestsback to summary
private final Boolean failIfNoTests
launcherback to summary
private @Nullable SuiteLauncher launcher
launcherDiscoveryResultback to summary
private @Nullable LauncherDiscoveryResult launcherDiscoveryResult
lifecycleMethodsback to summary
private final SuiteTestDescriptor.LifecycleMethods lifecycleMethods
outputDirectoryCreatorback to summary
private final OutputDirectoryCreator outputDirectoryCreator
SEGMENT_TYPEback to summary
pack-priv static final String SEGMENT_TYPE
suiteClassback to summary
private final Class<?> suiteClass

Constructor Detail

SuiteTestDescriptorback to summary
pack-priv SuiteTestDescriptor(UniqueId id, Class<?> suiteClass, ConfigurationParameters configurationParameters, OutputDirectoryCreator outputDirectoryCreator, EngineDiscoveryListener discoveryListener, DiscoveryIssueReporter issueReporter)

Method Detail

addDiscoveryRequestFromback to summary
pack-priv SuiteTestDescriptor addDiscoveryRequestFrom(Class<?> suiteClass)
addDiscoveryRequestFromback to summary
pack-priv SuiteTestDescriptor addDiscoveryRequestFrom(UniqueId uniqueId)
computeTestExecutionResultback to summary
private TestExecutionResult computeTestExecutionResult(@Nullable TestExecutionSummary summary, ThrowableCollector throwableCollector)
discoverback to summary
pack-priv void discover()
executeback to summary
pack-priv void execute(EngineExecutionListener executionListener, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken)
executeAfterSuiteMethodsback to summary
private void executeAfterSuiteMethods(ThrowableCollector throwableCollector)
executeBeforeSuiteMethodsback to summary
private void executeBeforeSuiteMethods(ThrowableCollector throwableCollector)
executeTestsback to summary
private @Nullable TestExecutionSummary executeTests(EngineExecutionListener executionListener, NamespacedHierarchicalStore<Namespace> requestLevelStore, CancellationToken cancellationToken, ThrowableCollector throwableCollector)
getFailIfNoTestsback to summary
private static Boolean getFailIfNoTests(Class<?> suiteClass)
getSuiteDisplayNameback to summary
private static String getSuiteDisplayName(Class<?> suiteClass, DiscoveryIssueReporter issueReporter)
getTypeback to summary
public TestDescriptor.Type getType()

Implements org.junit.platform.engine.TestDescriptor.getType.

Doc from org.junit.platform.engine.TestDescriptor.getType.

Determine the Type of this descriptor.

Annotations
@Override
mayRegisterTestsback to summary
public boolean mayRegisterTests()

Overrides default org.junit.platform.engine.TestDescriptor.mayRegisterTests.

Doc from org.junit.platform.engine.TestDescriptor.mayRegisterTests.

Determine if this descriptor may register dynamic tests during execution.

The default implementation assumes tests are usually known during discovery and thus returns false.

Annotations
@Override
org.junit.platform.suite.engine back to summary

private final Record SuiteTestDescriptor.DiscoveryIssueForwardingListener

extends Record
implements LauncherDiscoveryListener
Class Inheritance
All Implemented Interfaces
org.junit.platform.launcher.LauncherDiscoveryListener, org.junit.platform.engine.EngineDiscoveryListener
Record Components
discoveryListener:EngineDiscoveryListener 
issueTransformer:BiFunction<UniqueId, DiscoveryIssue, DiscoveryIssue> 

Field Summary

Modifier and TypeField and Description
private final EngineDiscoveryListener
discoveryListener

Record Component accessed by discoveryListener().

private final BiFunction<UniqueId, DiscoveryIssue, DiscoveryIssue>
issueTransformer

Record Component accessed by issueTransformer().

private static final Predicate<UniqueId.Segment>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static SuiteTestDescriptor.DiscoveryIssueForwardingListener
create(UniqueId id, EngineDiscoveryListener discoveryListener)

public EngineDiscoveryListener
discoveryListener()

Record Component getter of discoveryListener.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public void
issueEncountered(UniqueId engineUniqueId, DiscoveryIssue issue)

Overrides default org.junit.platform.engine.EngineDiscoveryListener.issueEncountered.

Called when the engine with the supplied engineId encountered an issue during test discovery.

public BiFunction<UniqueId, DiscoveryIssue, DiscoveryIssue>
issueTransformer()

Record Component getter of issueTransformer.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

discoveryListenerback to summary
private final EngineDiscoveryListener discoveryListener

Record Component accessed by discoveryListener().

issueTransformerback to summary
private final BiFunction<UniqueId, DiscoveryIssue, DiscoveryIssue> issueTransformer

Record Component accessed by issueTransformer().

SUITE_SEGMENTSback to summary
private static final Predicate<UniqueId.Segment> SUITE_SEGMENTS

Constructor Detail

DiscoveryIssueForwardingListenerback to summary
private DiscoveryIssueForwardingListener(EngineDiscoveryListener discoveryListener, BiFunction<UniqueId, DiscoveryIssue, DiscoveryIssue> issueTransformer)

Method Detail

createback to summary
pack-priv static SuiteTestDescriptor.DiscoveryIssueForwardingListener create(UniqueId id, EngineDiscoveryListener discoveryListener)
discoveryListenerback to summary
public EngineDiscoveryListener discoveryListener()

Record Component getter of discoveryListener.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

issueEncounteredback to summary
public void issueEncountered(UniqueId engineUniqueId, DiscoveryIssue issue)

Overrides default org.junit.platform.engine.EngineDiscoveryListener.issueEncountered.

Doc from org.junit.platform.engine.EngineDiscoveryListener.issueEncountered.

Called when the engine with the supplied engineId encountered an issue during test discovery.

Annotations
@Override
issueTransformerback to summary
public BiFunction<UniqueId, DiscoveryIssue, DiscoveryIssue> issueTransformer()

Record Component getter of issueTransformer.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

org.junit.platform.suite.engine back to summary

private Class SuiteTestDescriptor.LifecycleMethods

extends Object
Class Inheritance
  • java.lang.Object
  • org.junit.platform.suite.engine.SuiteTestDescriptor.LifecycleMethods

Field Summary

Modifier and TypeField and Description
pack-priv final List<Method>
pack-priv final List<Method>

Constructor Summary

AccessConstructor and Description
pack-priv
LifecycleMethods(Class<?> suiteClass, DiscoveryIssueReporter issueReporter)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

afterSuiteback to summary
pack-priv final List<Method> afterSuite
beforeSuiteback to summary
pack-priv final List<Method> beforeSuite

Constructor Detail

LifecycleMethodsback to summary
pack-priv LifecycleMethods(Class<?> suiteClass, DiscoveryIssueReporter issueReporter)