Class MethodSource
- java.lang.Object
-
- org.junit.platform.engine.support.descriptor.MethodSource
-
- All Implemented Interfaces:
java.io.Serializable,TestSource
@API(status=STABLE, since="1.0") public class MethodSource extends java.lang.Object implements TestSource
Java method basedTestSource.This class stores the method name along with 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(java.lang.Object o)static MethodSourcefrom(java.lang.reflect.Method method)Create a newMethodSourceusing the suppliedmethod.static MethodSourcefrom(java.lang.String className, java.lang.String methodName)Create a newMethodSourceusing the supplied class and method name.static MethodSourcefrom(java.lang.String className, java.lang.String methodName, java.lang.String methodParameterTypes)Create a newMethodSourceusing the supplied class and method name.java.lang.StringgetClassName()Get the declaringClassname of this source.java.lang.StringgetMethodName()Get theMethodname of this source.java.lang.StringgetMethodParameterTypes()Get theMethodparameter types of this source.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
from
public static MethodSource from(java.lang.String className, java.lang.String methodName)
Create a newMethodSourceusing the supplied class and method name.- Parameters:
className- theClassname; must not benullor blankmethodName- theMethodname; must not benullor blank
-
from
public static MethodSource from(java.lang.String className, java.lang.String methodName, java.lang.String methodParameterTypes)
Create a newMethodSourceusing the supplied class and method name.- Parameters:
className- theClassname; must not benullor blankmethodName- theMethodname; must not benullor blankmethodParameterTypes- theMethodparameter types as string
-
from
public static MethodSource from(java.lang.reflect.Method method)
Create a newMethodSourceusing the suppliedmethod.- Parameters:
method- the Java method; must not benull
-
getClassName
public java.lang.String getClassName()
Get the declaringClassname of this source.
-
getMethodName
public final java.lang.String getMethodName()
Get theMethodname of this source.
-
getMethodParameterTypes
public final java.lang.String getMethodParameterTypes()
Get theMethodparameter types of this source.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-