T - testing strategy typepublic abstract static class GradlePluginTestingStrategy.Spec<T extends GradlePluginTestingStrategy>
extends java.lang.Object
GradlePluginTestingStrategy.
The specification will walk through each element of a composite testing strategy as well as itself when testing the satisfaction.| Constructor and Description |
|---|
Spec() |
| Modifier and Type | Method and Description |
|---|---|
GradlePluginTestingStrategy.Spec<T> |
and(GradlePluginTestingStrategy.Spec<? super T> spec)
Returns a specification that intersect between this spec and the specified spec.
|
abstract boolean |
isSatisfiedBy(T t) |
static <T extends GradlePluginTestingStrategy> |
matches(java.util.function.Predicate<? super T> predicate)
Returns a specification that matches any testing strategy against the specified predicate.
|
GradlePluginTestingStrategy.Spec<T> |
negate()
Returns a specification that negate this spec.
|
GradlePluginTestingStrategy.Spec<T> |
or(GradlePluginTestingStrategy.Spec<? super T> spec)
Returns a specification that union between this spec and the specified spec.
|
public abstract boolean isSatisfiedBy(@Nullable
T t)
public GradlePluginTestingStrategy.Spec<T> and(GradlePluginTestingStrategy.Spec<? super T> spec)
spec - a intersect spec, must not be nullpublic GradlePluginTestingStrategy.Spec<T> or(GradlePluginTestingStrategy.Spec<? super T> spec)
spec - a union spec, must not be nullpublic GradlePluginTestingStrategy.Spec<T> negate()
public static <T extends GradlePluginTestingStrategy> GradlePluginTestingStrategy.Spec<T> matches(java.util.function.Predicate<? super T> predicate)
composite testing strategy, the specification will first test the whole composite against the predicate followed by a successive test of each composed testing strategy.
def strategy = test.strategies.composite(jdk9, gradle7)
assert matches({ it == jdk9 }).isSatisfiedBy(strategy)
assert matches({ it == jdk9 }).and(matches({it == gradle7 })).isSatisfiedBy(strategy)
assert !matches({ it == jdk11 }).isSatisfiedBy(strategy)
T - testing strategy type to satisfypredicate - a predicate to match any testing strategy, must not be null