Annotation Type SelectMethod
-
@Retention(RUNTIME) @Target(TYPE) @Inherited @Documented @API(status=EXPERIMENTAL, since="1.10") @Repeatable(SelectMethods.class) public @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:
Suite
,JUnitPlatform
,DiscoverySelectors.selectMethod(String)
,DiscoverySelectors.selectMethod(String, String, String)
,DiscoverySelectors.selectMethod(String, String, Class...)
,DiscoverySelectors.selectMethod(Class, String, String)
,DiscoverySelectors.selectMethod(Class, String, Class...)
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.String
name
The name of the method to select; never blank unlessvalue()
is used.java.lang.String
parameterTypeNames
The parameter types of the method to select.java.lang.Class<?>[]
parameterTypes
The parameter types of the method to select.java.lang.Class<?>
type
The class in which the method is declared, or a subclass thereof.java.lang.String
typeName
The fully qualified class name in which the method is declared, or a subclass thereof.java.lang.String
value
The fully qualified method name of the method to select.
-
-
-
Element Detail
-
value
java.lang.String value
The 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:
DiscoverySelectors.selectMethod(String)
- Default:
- ""
-
-
-
type
java.lang.Class<?> type
The class in which the method is declared, or a subclass thereof.Cannot be used in conjunction with
typeName()
.- Default:
- java.lang.Class.class
-
-
-
typeName
java.lang.String typeName
The fully qualified class name in which the method is declared, or a subclass thereof.Cannot be used in conjunction with
type()
.- Default:
- ""
-
-
-
name
java.lang.String name
The name of the method to select; never blank unlessvalue()
is used.- Default:
- ""
-
-
-
parameterTypes
java.lang.Class<?>[] parameterTypes
The parameter types of the method to select.Cannot be used in conjunction with
parameterTypeNames()
.- Default:
- {}
-
-
-
parameterTypeNames
java.lang.String parameterTypeNames
The 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:
- ""
-
-