Module org.junit.platform.engine
Class ClasspathResourceSelector
java.lang.Object
org.junit.platform.engine.discovery.ClasspathResourceSelector
- All Implemented Interfaces:
DiscoverySelector
@API(status=STABLE,
since="1.0")
public class ClasspathResourceSelector
extends Object
implements DiscoverySelector
A
DiscoverySelector
that selects the name of a classpath resource
so that TestEngines
can load resources
from the classpath — for example, to load XML or JSON files from the classpath,
potentially within JARs.
Since engines are not expected to modify the classpath, the classpath resource represented by this selector must be on the classpath of the context class loader of the thread that uses it.
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the name of the selected classpath resource.Get the selectedFilePosition
within the classpath resource.int
hashCode()
Return the identifier of this selector.toString()
-
Method Details
-
getClasspathResourceName
Get the name of the selected classpath resource.The name of a classpath resource must follow the semantics for resource paths as defined in
ClassLoader.getResource(String)
.- See Also:
-
getPosition
Get the selectedFilePosition
within the classpath resource. -
equals
-
hashCode
-
toString
-
toIdentifier
Description copied from interface:DiscoverySelector
Return the identifier of this selector.The returned identifier has to be parsable by a corresponding
DiscoverySelectorIdentifierParser
.- Specified by:
toIdentifier
in interfaceDiscoverySelector
- Returns:
- the identifier of this selector or empty if it is not supported;
never
null
-