Package dev.gradleplugins
Class GradlePluginTestingStrategy.Spec<T extends GradlePluginTestingStrategy>
- java.lang.Object
-
- dev.gradleplugins.GradlePluginTestingStrategy.Spec<T>
-
- Type Parameters:
T- testing strategy type
- Enclosing interface:
- GradlePluginTestingStrategy
public abstract static class GradlePluginTestingStrategy.Spec<T extends GradlePluginTestingStrategy> extends java.lang.ObjectRepresents specification forGradlePluginTestingStrategy. The specification will walk through each element of a composite testing strategy as well as itself when testing the satisfaction.
-
-
Constructor Summary
Constructors Constructor Description Spec()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description GradlePluginTestingStrategy.Spec<T>and(GradlePluginTestingStrategy.Spec<? super T> spec)Returns a specification that intersect between this spec and the specified spec.abstract booleanisSatisfiedBy(T t)static <T extends GradlePluginTestingStrategy>
GradlePluginTestingStrategy.Spec<T>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.
-
-
-
Method Detail
-
isSatisfiedBy
public abstract boolean isSatisfiedBy(@Nullable T t)
-
and
public GradlePluginTestingStrategy.Spec<T> and(GradlePluginTestingStrategy.Spec<? super T> spec)
Returns a specification that intersect between this spec and the specified spec.- Parameters:
spec- a intersect spec, must not be null- Returns:
- a intersect specification, never null
-
or
public GradlePluginTestingStrategy.Spec<T> or(GradlePluginTestingStrategy.Spec<? super T> spec)
Returns a specification that union between this spec and the specified spec.- Parameters:
spec- a union spec, must not be null- Returns:
- a union specification, never null
-
negate
public GradlePluginTestingStrategy.Spec<T> negate()
Returns a specification that negate this spec.- Returns:
- a negation specification, never null
-
matches
public static <T extends GradlePluginTestingStrategy> GradlePluginTestingStrategy.Spec<T> matches(java.util.function.Predicate<? super T> predicate)
Returns a specification that matches any testing strategy against the specified predicate. In the case of acomposite 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)- Type Parameters:
T- testing strategy type to satisfy- Parameters:
predicate- a predicate to match any testing strategy, must not be null- Returns:
- a specification that matches any testing strategy with the specified predicate, never null
-
-