Top Description Fields Methods
org.junit.platform.engine.discovery

public Interface ClassNameFilter

extends DiscoveryFilter<String>
Known Direct Implementers
org.junit.platform.engine.discovery.AbstractClassNameFilter
Annotations
@API
status:STABLE
since:1.0
Static Imports
org.apiguardian.api.API.Status.STABLE

DiscoveryFilter that is applied to the name of a Class.
Since
1.0
See Also
includeClassNamePatterns(String...), excludeClassNamePatterns(String...), PackageNameFilter

Field Summary

Modifier and TypeField and Description
public static final String
STANDARD_INCLUDE_PATTERN

Standard include pattern in the form of a regular expression that is used to match against fully qualified class names: ^(Test.*|.+[.$]Test.*|.*Tests?)$

This pattern matches against class names beginning with Test or ending with Test or Tests (in any package).

Method Summary

Modifier and TypeMethod and Description
public static ClassNameFilter
excludeClassNamePatterns(String...
regular expressions to match against fully qualified class names; never null, empty, or containing null
patterns
)

Create a new exclude ClassNameFilter based on the supplied patterns.

public static ClassNameFilter
includeClassNamePatterns(String...
regular expressions to match against fully qualified class names; never null, empty, or containing null
patterns
)

Create a new include ClassNameFilter based on the supplied patterns.

Field Detail

STANDARD_INCLUDE_PATTERNback to summary
public static final String STANDARD_INCLUDE_PATTERN

Standard include pattern in the form of a regular expression that is used to match against fully qualified class names: ^(Test.*|.+[.$]Test.*|.*Tests?)$

This pattern matches against class names beginning with Test or ending with Test or Tests (in any package).

Method Detail

excludeClassNamePatternsback to summary
public static ClassNameFilter excludeClassNamePatterns(String... patterns)

Create a new exclude ClassNameFilter based on the supplied patterns.

The patterns are combined using OR semantics, i.e. if the fully qualified name of a class matches against at least one of the patterns, the class will be excluded from the result set.

Parameters
patterns:String[]

regular expressions to match against fully qualified class names; never null, empty, or containing null

See Also
Class#getName(), includeClassNamePatterns(String...)
includeClassNamePatternsback to summary
public static ClassNameFilter includeClassNamePatterns(String... patterns)

Create a new include ClassNameFilter based on the supplied patterns.

The patterns are combined using OR semantics, i.e. if the fully qualified name of a class matches against at least one of the patterns, the class will be included in the result set.

Parameters
patterns:String[]

regular expressions to match against fully qualified class names; never null, empty, or containing null

See Also
Class#getName(), excludeClassNamePatterns(String...)