public final class JkTestSelection<T>
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
By default, when no include/exclude pattern/tag are specified, the selector get all classes under defined class root dirs.
Modifier and Type | Field and Description |
---|---|
T |
__
For parent chaining
|
static java.lang.String |
IT_INCLUDE_PATTERN |
static java.lang.String |
STANDARD_INCLUDE_PATTERN |
Modifier and Type | Method and Description |
---|---|
JkTestSelection<T> |
addExcludePatterns(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection<T> |
addExcludePatterns(java.lang.String... patterns) |
JkTestSelection<T> |
addExcludeTags(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection<T> |
addExcludeTags(java.lang.String... patterns) |
JkTestSelection<T> |
addIncludePatterns(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection<T> |
addIncludePatterns(java.lang.String... patterns) |
JkTestSelection<T> |
addIncludePatternsIf(boolean condition,
java.lang.String... patterns) |
JkTestSelection<T> |
addIncludeStandardPatterns() |
JkTestSelection<T> |
addIncludeTags(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection<T> |
addIncludeTags(java.lang.String... patterns) |
JkTestSelection<T> |
addTestClassRoots(java.lang.Iterable<java.nio.file.Path> paths)
Adds specified dir to the test class root directories.
|
JkTestSelection |
clone() |
JkUnaryOperator<org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder> |
getDiscoveryConfigurer() |
java.util.Set<java.lang.String> |
getExcludePatterns()
Returns an unmodifiable set of exclude classname patterns.
|
java.util.Set<java.lang.String> |
getExcludeTags() |
java.util.Set<java.lang.String> |
getIncludePatterns()
Returns an unmodifiable set of include classname patterns (ex : ".*IT")
|
java.util.Set<java.lang.String> |
getIncludeTags() |
JkPathSequence |
getTestClassRoots()
Returns the test class rot dirs to discover the tests from.
|
static JkTestSelection<java.lang.Void> |
of()
Creates an empty testSet
The created instance does not include any include filter nor class root dirs
so no test will be included out of the box.
|
static <T> JkTestSelection<T> |
ofParent(T parent)
Same as
of() but mentioning a parent for chaining |
JkTestSelection<T> |
setDiscoveryConfigurer(JkUnaryOperator<org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder> discoveryConfigurer)
Set a native Junit-platform configurer to build the
LauncherDiscoveryRequest
passed to Junit-platform. |
JkTestSelection<T> |
setTestClassRoots(java.util.function.UnaryOperator<JkPathSequence> pathSequencer) |
java.lang.String |
toString() |
public static final java.lang.String STANDARD_INCLUDE_PATTERN
public static final java.lang.String IT_INCLUDE_PATTERN
public final transient T __
public static JkTestSelection<java.lang.Void> of()
public static <T> JkTestSelection<T> ofParent(T parent)
of()
but mentioning a parent for chainingpublic JkPathSequence getTestClassRoots()
public JkTestSelection<T> addTestClassRoots(java.lang.Iterable<java.nio.file.Path> paths)
public java.util.Set<java.lang.String> getIncludePatterns()
public JkTestSelection<T> addIncludePatterns(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection<T> addIncludeStandardPatterns()
public JkTestSelection<T> addIncludePatterns(java.lang.String... patterns)
public JkTestSelection<T> addIncludePatternsIf(boolean condition, java.lang.String... patterns)
public java.util.Set<java.lang.String> getExcludePatterns()
public JkTestSelection<T> addExcludePatterns(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection<T> addExcludePatterns(java.lang.String... patterns)
public java.util.Set<java.lang.String> getIncludeTags()
public JkTestSelection<T> addIncludeTags(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection<T> addIncludeTags(java.lang.String... patterns)
public java.util.Set<java.lang.String> getExcludeTags()
public JkTestSelection<T> addExcludeTags(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection<T> addExcludeTags(java.lang.String... patterns)
public JkUnaryOperator<org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder> getDiscoveryConfigurer()
public JkTestSelection<T> setTestClassRoots(java.util.function.UnaryOperator<JkPathSequence> pathSequencer)
public JkTestSelection<T> setDiscoveryConfigurer(JkUnaryOperator<org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder> discoveryConfigurer)
LauncherDiscoveryRequest
passed to Junit-platform. The configurer will apply on a builder instance created from
patterns, tags and class root dirs defined in this instance.
setDiscoveryConfigurer(classpath, builder -> builder
.filters(
ClassNameFilter.includeClassNamePatterns(ClassNameFilter.STANDARD_INCLUDE_PATTERN)
)
.selectors(DiscoverySelectors.selectMethod("mytest.MyTest#toto"))
.configurationParameter("run.it", "false")
);
public JkTestSelection clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object