@API(status=STABLE, since="1.0") public class MethodSelector extends Object implements DiscoverySelector
DiscoverySelectorthat selects a
Methodor a combination of class name, method name, and parameter types so that
TestEnginescan 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 simply a fully qualified method name is provided,
this selector will only attempt to lazily load the
In this context, a Java
Method means anything that can be referenced
Method on the JVM — for example, methods from Java classes
or methods from other JVM languages such Groovy, Scala, etc.
|Modifier and Type||Method and Description|
Get the selected class name.
Get the selected
Get the selected method name.
Get the parameter types for the selected method as a
public String getClassName()
public String getMethodName()
public String getMethodParameterTypes()
String, typically a comma-separated list of primitive types, fully qualified class names, or array types.
Note: the 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.
MethodSelectorvia a constructor or deduced from a
Methodsupplied via a constructor; never
public Class<?> getJavaClass()
Classin which the selected method is declared, or a subclass thereof.
public Method getJavaMethod()