Class IterationSelector
- java.lang.Object
-
- org.junit.platform.engine.discovery.IterationSelector
-
- All Implemented Interfaces:
DiscoverySelector
@API(status=MAINTAINED, since="1.13.3") public class IterationSelector extends java.lang.Object implements DiscoverySelectorADiscoverySelectorthat selects the iterations of a parentDiscoverySelectorvia their indices so thatTestEnginescan discover a subset of the iterations of tests or containers.- Since:
- 1.9
- See Also:
DiscoverySelectors.selectIteration(DiscoverySelector, int...)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classIterationSelector.IdentifierParser
-
Field Summary
Fields Modifier and Type Field Description private java.util.SortedSet<java.lang.Integer>iterationIndicesprivate DiscoverySelectorparentSelector
-
Constructor Summary
Constructors Constructor Description IterationSelector(DiscoverySelector parentSelector, int... iterationIndices)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)private java.lang.StringformatIterationIndicesAsRanges()java.util.SortedSet<java.lang.Integer>getIterationIndices()Get the selected iteration indices.DiscoverySelectorgetParentSelector()Get the selected parentDiscoverySelector.inthashCode()java.util.Optional<DiscoverySelectorIdentifier>toIdentifier()Return the identifier of this selector.private java.util.SortedSet<java.lang.Integer>toSortedSet(int[] iterationIndices)java.lang.StringtoString()
-
-
-
Field Detail
-
parentSelector
private final DiscoverySelector parentSelector
-
iterationIndices
private final java.util.SortedSet<java.lang.Integer> iterationIndices
-
-
Constructor Detail
-
IterationSelector
IterationSelector(DiscoverySelector parentSelector, int... iterationIndices)
-
-
Method Detail
-
toSortedSet
private java.util.SortedSet<java.lang.Integer> toSortedSet(int[] iterationIndices)
-
getParentSelector
public DiscoverySelector getParentSelector()
Get the selected parentDiscoverySelector.
-
getIterationIndices
public java.util.SortedSet<java.lang.Integer> getIterationIndices()
Get the selected iteration indices.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toIdentifier
public java.util.Optional<DiscoverySelectorIdentifier> toIdentifier()
Description copied from interface:DiscoverySelectorReturn the identifier of this selector.The returned identifier must be parsable by a corresponding
DiscoverySelectorIdentifierParser.The default implementation returns
Optional.empty(). Can be overridden by concrete implementations.- Specified by:
toIdentifierin interfaceDiscoverySelector- Returns:
- an
Optionalcontaining the identifier of this selector; nevernullbut potentially empty if the selector does not support identifiers
-
formatIterationIndicesAsRanges
private java.lang.String formatIterationIndicesAsRanges()
-
-