Annotation Interface SelectMethod
@SelectMethod
is a repeatable annotation that
specifies a method to select when running a test suite on the JUnit
Platform.- Since:
- 1.10
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionThe name of the method to select; never blank unlessvalue()
is used.The parameter types of the method to select.Class<?>[]
The parameter types of the method to select.Class
<?> The class in which the method is declared, or a subclass thereof.The fully qualified class name in which the method is declared, or a subclass thereof.The fully qualified method name of the method to select.
-
Element Details
-
value
String valueThe fully qualified method name of the method to select.The following formats are supported.
[fully qualified class name]#[methodName]
[fully qualified class name]#[methodName](parameter type list)
The parameter type list is a comma-separated list of primitive names or fully qualified class names for the types of parameters accepted by the method.
Array parameter types may be specified using either the JVM's internal String representation (e.g.,
[[I
forint[][]
,[Ljava.lang.String;
forjava.lang.String[]
, etc.) or source code syntax (e.g.,int[][]
,java.lang.String[]
, etc.).Examples Method Fully Qualified Method Name java.lang.String.chars()
java.lang.String#chars
java.lang.String.chars()
java.lang.String#chars()
java.lang.String.equalsIgnoreCase(String)
java.lang.String#equalsIgnoreCase(java.lang.String)
java.lang.String.substring(int, int)
java.lang.String#substring(int, int)
example.Calc.avg(int[])
example.Calc#avg([I)
example.Calc.avg(int[])
example.Calc#avg(int[])
example.Matrix.multiply(double[][])
example.Matrix#multiply([[D)
example.Matrix.multiply(double[][])
example.Matrix#multiply(double[][])
example.Service.process(String[])
example.Service#process([Ljava.lang.String;)
example.Service.process(String[])
example.Service#process(java.lang.String[])
example.Service.process(String[][])
example.Service#process([[Ljava.lang.String;)
example.Service.process(String[][])
example.Service#process(java.lang.String[][])
Cannot be combined with any other attribute.
- See Also:
- Default:
""
-
type
Class<?> typeThe class in which the method is declared, or a subclass thereof.Cannot be used in conjunction with
typeName()
.- Default:
java.lang.Class.class
-
typeName
String typeNameThe fully qualified class name in which the method is declared, or a subclass thereof.Cannot be used in conjunction with
type()
.- Default:
""
-
name
String nameThe name of the method to select; never blank unlessvalue()
is used.- Default:
""
-
parameterTypes
Class<?>[] parameterTypesThe parameter types of the method to select.Cannot be used in conjunction with
parameterTypeNames()
.- Default:
{}
-
parameterTypeNames
String parameterTypeNamesThe parameter types of the method to select.This is typically a comma-separated list of atomic types, fully qualified class names, or array types; however, the exact syntax depends on the underlying test engine.
If the method takes no parameters, this attribute must be an empty string.
Array parameter types may be specified using either the JVM's internal String representation (e.g.,
[[I
forint[][]
,[Ljava.lang.String;
forjava.lang.String[]
, etc.) or source code syntax (e.g.,int[][]
,java.lang.String[]
, etc.).Examples Method Parameter types list java.lang.String.chars()
The empty string java.lang.String.equalsIgnoreCase(String)
java.lang.String
java.lang.String.substring(int, int)
int, int
example.Calc.avg(int[])
[I
example.Calc.avg(int[])
int[]
example.Matrix.multiply(double[][])
[[D
example.Matrix.multiply(double[][])
double[][]
example.Service.process(String[])
[Ljava.lang.String;
example.Service.process(String[])
java.lang.String[]
example.Service.process(String[][])
[[Ljava.lang.String;
example.Service.process(String[][])
java.lang.String[][]
Cannot be used in conjunction with
parameterTypes()
.- Default:
""
-