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.
Note
Since Java 9, all resources are on the module path. Either in named or unnamed modules. These resources are also considered to be classpath resources.
DiscoverySelectors#selectClasspathResource(String), ClasspathRootSelector, getClasspathResourceName()
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final @Nullable FilePosition | |
| private @Nullable Set |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public String | |
| public Set | getClasspathResources()
Deprecated
for removal since 1.14. Please use {
getResources()} instead.
Get the selected |
| public Optional | |
| public Set | |
| public int | |
| public Optional | toIdentifier()
Overrides default org. Return the identifier of this selector. |
| public String |
| classpathResourceName | back to summary |
|---|---|
| private final String classpathResourceName | |
| position | back to summary |
|---|---|
| private final @Nullable FilePosition position | |
| resources | back to summary |
|---|---|
| private @Nullable Set<Resource> resources | |
| ClasspathResourceSelector | back to summary |
|---|---|
| pack-priv ClasspathResourceSelector(String classpathResourceName, @Nullable FilePosition position) | |
| ClasspathResourceSelector | back to summary |
|---|---|
| pack-priv ClasspathResourceSelector(Set<? extends Resource> resources) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getClasspathResourceName | back to summary |
|---|---|
| public String 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 | |
| getClasspathResources | back to summary |
|---|---|
| public Set Get the selected If the
| |
| getPosition | back to summary |
|---|---|
| public Optional Get the selected | |
| getResources | back to summary |
|---|---|
| public Set Get the selected If the
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toIdentifier | back to summary |
|---|---|
| public Optional Overrides default org. Doc from org. Return the identifier of this selector. The returned identifier must be parsable by a corresponding
The default implementation returns
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | getPrefix()
Implements org. Get the prefix that this parser supports. |
| public Optional | parse(DiscoverySelectorIdentifier identifier, DiscoverySelectorIdentifierParser.
Implements org. Parse the supplied |
| PREFIX | back to summary |
|---|---|
| private static final String PREFIX | |
| IdentifierParser | back to summary |
|---|---|
| public IdentifierParser() | |
| getPrefix | back to summary |
|---|---|
| public String getPrefix() Implements org. Doc from org. Get the prefix that this parser supports.
| |
| parse | back to summary |
|---|---|
| public Optional Implements org. Doc from org. Parse the supplied The JUnit Platform will only invoke this method if the supplied
| |