public final class JkTestSelection
extends java.lang.Object
implements 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 |
---|---|
static java.lang.String |
E2E_PATTERN
A regular expression that matches strings beginning with "e2e.".
|
static java.lang.String |
IT_PATTERN
A regular expression pattern for selecting integration test classes.
|
static java.lang.String |
MAVEN_INCLUDE_PATTERN |
Modifier and Type | Method and Description |
---|---|
JkTestSelection |
addExcludePatterns(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection |
addExcludePatterns(java.lang.String... patterns)
Adds the specified exclude patterns to the current test selection.
|
JkTestSelection |
addExcludePatternsIf(boolean condition,
java.lang.String... patterns) |
JkTestSelection |
addExcludeTags(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection |
addExcludeTags(java.lang.String... patterns) |
JkTestSelection |
addIncludeMavenPatterns() |
JkTestSelection |
addIncludePatterns(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection |
addIncludePatterns(java.lang.String... patterns) |
JkTestSelection |
addIncludePatternsIf(boolean condition,
java.lang.String... patterns) |
JkTestSelection |
addIncludeTags(java.lang.Iterable<java.lang.String> patterns) |
JkTestSelection |
addIncludeTags(java.lang.String... patterns) |
JkTestSelection |
copy() |
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 |
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.
|
JkTestSelection |
setDiscoveryConfigurer(JkUnaryOperator<org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder> discoveryConfigurer)
Set a native Junit-platform configurer to build the
LauncherDiscoveryRequest
passed to Junit-platform. |
JkTestSelection |
setIncludePatterns(java.util.Collection<java.lang.String> includePatterns)
Sets the include patterns for selecting test classes.
|
java.lang.String |
toString() |
public static final java.lang.String MAVEN_INCLUDE_PATTERN
public static final java.lang.String IT_PATTERN
Integration tests are tests run within the regular test phase but running slower than regular unit tests.
public static final java.lang.String E2E_PATTERN
This regular expression is commonly used to identify fully qualified end-to-end (E2E) classes that belong to the e2e package.
End-to-end tests are tests running in e2eTest after the application or library has been packaged.
public static JkTestSelection of()
public JkPathSequence getTestClassRoots()
public java.util.Set<java.lang.String> getIncludePatterns()
public JkTestSelection addIncludePatterns(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection addIncludeMavenPatterns()
public JkTestSelection addIncludePatterns(java.lang.String... patterns)
public JkTestSelection addIncludePatternsIf(boolean condition, java.lang.String... patterns)
public java.util.Set<java.lang.String> getExcludePatterns()
public JkTestSelection addExcludePatterns(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection addExcludePatterns(java.lang.String... patterns)
public JkTestSelection addExcludePatternsIf(boolean condition, java.lang.String... patterns)
public java.util.Set<java.lang.String> getIncludeTags()
public JkTestSelection addIncludeTags(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection addIncludeTags(java.lang.String... patterns)
public java.util.Set<java.lang.String> getExcludeTags()
public JkTestSelection addExcludeTags(java.lang.Iterable<java.lang.String> patterns)
public JkTestSelection addExcludeTags(java.lang.String... patterns)
public JkUnaryOperator<org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder> getDiscoveryConfigurer()
public JkTestSelection setIncludePatterns(java.util.Collection<java.lang.String> includePatterns)
public JkTestSelection 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 copy()
public java.lang.String toString()
toString
in class java.lang.Object