Class MethodSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.MethodSource
-
- All Implemented Interfaces:
Serializable,TestSource
@API(status=STABLE, since="1.0") public class MethodSource extends Object implements TestSource
Method basedTestSource.This class stores the method name along with the names of its parameter types because
Methoddoes not implementSerializable.- Since:
- 1.0
- See Also:
MethodSelector, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)static MethodSourcefrom(Class<?> testClass, Method testMethod)static MethodSourcefrom(Method testMethod)Create a newMethodSourceusing the suppliedmethod.static MethodSourcefrom(String className, String methodName)Create a newMethodSourceusing the supplied class name and method name.static MethodSourcefrom(String className, String methodName, Class<?>... methodParameterTypes)Create a newMethodSourceusing the supplied class name, method name, and method parameter types.static MethodSourcefrom(String className, String methodName, String methodParameterTypes)Create a newMethodSourceusing the supplied class name, method name, and method parameter types.StringgetClassName()Get the class name of this source.StringgetMethodName()Get the method name of this source.StringgetMethodParameterTypes()Get the method parameter types of this source.inthashCode()StringtoString()
-
-
-
Method Detail
-
from
public static MethodSource from(String className, String methodName)
Create a newMethodSourceusing the supplied class name and method name.- Parameters:
className- the class name; must not benullor blankmethodName- the method name; must not benullor blank
-
from
public static MethodSource from(String className, String methodName, String methodParameterTypes)
Create a newMethodSourceusing the supplied class name, method name, and method parameter types.- Parameters:
className- the class name; must not benullor blankmethodName- the method name; must not benullor blankmethodParameterTypes- a comma-separated list of fully qualified class names representing the method parameter types
-
from
@API(status=STABLE, since="1.5") public static MethodSource from(String className, String methodName, Class<?>... methodParameterTypes)
Create a newMethodSourceusing the supplied class name, method name, and method parameter types.- Parameters:
className- the class name; must not benullor blankmethodName- the method name; must not benullor blankmethodParameterTypes- a varargs array of classes representing the method parameter types- Since:
- 1.5
-
from
public static MethodSource from(Method testMethod)
Create a newMethodSourceusing the suppliedmethod.- Parameters:
testMethod- the Java method; must not benull- See Also:
from(Class, Method)
-
from
@API(status=STABLE, since="1.3") public static MethodSource from(Class<?> testClass, Method testMethod)
Create a newMethodSourceusing the suppliedclassandmethod.This method should be used in favor of
from(Method)if the test method is inherited from a superclass or present as an interfacedefaultmethod.- Parameters:
testClass- the Java class; must not benulltestMethod- the Java method; must not benull- Since:
- 1.3
-
getClassName
public String getClassName()
Get the class name of this source.
-
getMethodName
public final String getMethodName()
Get the method name of this source.
-
getMethodParameterTypes
public final String getMethodParameterTypes()
Get the method parameter types of this source.
-
-