Class IncludePackageNameFilter
- java.lang.Object
-
- org.junit.platform.engine.discovery.IncludePackageNameFilter
-
- All Implemented Interfaces:
PackageNameFilter
,DiscoveryFilter<java.lang.String>
,Filter<java.lang.String>
class IncludePackageNameFilter extends java.lang.Object implements PackageNameFilter
PackageNameFilter
that matches fully qualified package names that are prefixed by one of the package names provided to the filter.If the fully qualified name of a package starts with at least one of the packages names of the filter, the package will be included.
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
packageNames
private java.lang.String
patternDescription
-
Constructor Summary
Constructors Constructor Description IncludePackageNameFilter(java.lang.String... packageNames)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FilterResult
apply(java.lang.String packageName)
Apply this filter to the supplied object.private java.util.Optional<java.lang.String>
findMatchingName(java.lang.String packageName)
private java.lang.String
formatExclusionReason(java.lang.String packageName)
private java.lang.String
formatInclusionReason(java.lang.String packageName, java.lang.String matchedName)
java.util.function.Predicate<java.lang.String>
toPredicate()
Return aPredicate
that returnstrue
if this filter includes the object supplied to the predicate'stest
method.java.lang.String
toString()
-
-
-
Method Detail
-
apply
public FilterResult apply(java.lang.String packageName)
Description copied from interface:Filter
Apply this filter to the supplied object.
-
formatInclusionReason
private java.lang.String formatInclusionReason(java.lang.String packageName, java.lang.String matchedName)
-
formatExclusionReason
private java.lang.String formatExclusionReason(java.lang.String packageName)
-
toPredicate
public java.util.function.Predicate<java.lang.String> toPredicate()
Description copied from interface:Filter
Return aPredicate
that returnstrue
if this filter includes the object supplied to the predicate'stest
method.- Specified by:
toPredicate
in interfaceFilter<java.lang.String>
-
findMatchingName
private java.util.Optional<java.lang.String> findMatchingName(java.lang.String packageName)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-