DiscoverySelector that selects a Method or a combination of
class name, method name, and parameter types so that
TestEngines can discover tests
or containers based on methods.
If a Java Method is provided, the selector will return that
method and its method name, class name, and
parameter types accordingly. If a Class and method name, a class name
and method name, or a fully qualified method name is provided,
this selector will only attempt to lazily load the class, method, or parameter
types if getJavaClass(), getJavaMethod(), or
getParameterTypes() is invoked.
In this context, a Java Method means anything that can be referenced
as a Method on the JVM — for example, methods from Java classes
or methods from other JVM languages such Groovy, Scala, etc.
DiscoverySelectors#selectMethod(String), DiscoverySelectors#selectMethod(String, String), DiscoverySelectors#selectMethod(String, String, String), DiscoverySelectors#selectMethod(Class, String), DiscoverySelectors#selectMethod(Class, String, String), DiscoverySelectors#selectMethod(Class, Method), org.junit.platform.engine.support.descriptor.MethodSource
| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| private final @Nullable ClassLoader | |
| private final String | |
| private volatile @Nullable Class | |
| private volatile @Nullable Method | |
| private final String | |
| private final String | |
| private volatile @Nullable Class |
| Access | Constructor and Description |
|---|---|
| pack-priv | MethodSelector(@Nullable ClassLoader classLoader, String className, String methodName, String parameterTypeNames)
|
| pack-priv | |
| pack-priv | MethodSelector(@Nullable ClassLoader classLoader, String className, String methodName, Class<?>... parameterTypes)
|
| pack-priv | |
| pack-priv | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object o)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public @Nullable ClassLoader | Returns: theClassLoader; potentially nullGet the |
| public String | |
| public Class | |
| public Method | |
| public String | |
| public String | Returns: the names of parameter types supplied to thisMethodSelector
via a constructor or deduced from a Method or parameter types supplied
via a constructor; never null but potentially an empty stringGet the names of parameter types for the selected method as a |
| public Class | Returns: the method's parameter types; nevernull but potentially
an empty array if the selected method does not declare parametersGet the parameter types for the selected method. |
| public int | |
| private Class | |
| private Method | |
| private Class | |
| public Optional | toIdentifier()
Overrides default org. Return the identifier of this selector. |
| public String |
| classLoader | back to summary |
|---|---|
| private final @Nullable ClassLoader classLoader | |
| className | back to summary |
|---|---|
| private final String className | |
| javaClass | back to summary |
|---|---|
| private volatile @Nullable Class<?> javaClass | |
| javaMethod | back to summary |
|---|---|
| private volatile @Nullable Method javaMethod | |
| methodName | back to summary |
|---|---|
| private final String methodName | |
| parameterTypeNames | back to summary |
|---|---|
| private final String parameterTypeNames | |
| parameterTypes | back to summary |
|---|---|
| private volatile @Nullable Class<?>[] parameterTypes | |
| MethodSelector | back to summary |
|---|---|
pack-priv MethodSelector(@Nullable ClassLoader classLoader, String className, String methodName, String parameterTypeNames)
| |
| MethodSelector | back to summary |
|---|---|
| pack-priv MethodSelector(Class<?> javaClass, String methodName, String parameterTypeNames) | |
| MethodSelector | back to summary |
|---|---|
pack-priv MethodSelector(@Nullable ClassLoader classLoader, String className, String methodName, Class<?>... parameterTypes)
| |
| MethodSelector | back to summary |
|---|---|
pack-priv MethodSelector(Class<?> javaClass, String methodName, Class<?>... parameterTypes)
| |
| MethodSelector | back to summary |
|---|---|
| pack-priv MethodSelector(Class<?> javaClass, Method method) | |
| MethodSelector | back to summary |
|---|---|
| private MethodSelector(Class<?> javaClass, Method method, Class<?>... parameterTypes) | |
| 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. | |
| getClassLoader | back to summary |
|---|---|
| public @Nullable ClassLoader getClassLoader() Get the
| |
| getClassName | back to summary |
|---|---|
| public String getClassName() Get the selected class name. | |
| getJavaClass | back to summary |
|---|---|
| public Class Get the If the
| |
| getJavaMethod | back to summary |
|---|---|
| public Method getJavaMethod() Get the selected If the
| |
| getMethodName | back to summary |
|---|---|
| public String getMethodName() Get the selected method name. | |
| getParameterTypeNames | back to summary |
|---|---|
| public String getParameterTypeNames() Get the names of parameter types for the selected method as a Note the names of parameter types are provided as a single string instead of a collection in order to allow this selector to be used in a generic fashion by various test engines. It is therefore the responsibility of the caller of this method to determine how to parse the returned string.
| |
| getParameterTypes | back to summary |
|---|---|
| public Class Get the parameter types for the selected method. If the parameter types were not provided as
| |
| 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
| |
| lazyLoadJavaClass | back to summary |
|---|---|
| private Class | |
| lazyLoadJavaMethod | back to summary |
|---|---|
| private Method lazyLoadJavaMethod() | |
| lazyLoadParameterTypes | back to summary |
|---|---|
| private Class | |
| 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
| |