public class FrameworkMethod extends FrameworkMember<FrameworkMethod>
@Test
, @Before
, @After
, @BeforeClass
,
@AfterClass
, etc.)Constructor and Description |
---|
FrameworkMethod(java.lang.reflect.Method method)
Returns a new
FrameworkMethod for method |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
<T extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<T> annotationType)
Returns the annotation of type
annotationType on this method, if
one exists. |
java.lang.annotation.Annotation[] |
getAnnotations()
Returns the annotations on this method
|
java.lang.reflect.Method |
getMethod()
Returns the underlying Java method
|
java.lang.String |
getName()
Returns the method's name
|
java.lang.Class<?> |
getReturnType()
Returns the return type of the method
|
java.lang.Class<?> |
getType()
Returns the return type of the method
|
int |
hashCode() |
java.lang.Object |
invokeExplosively(java.lang.Object target,
java.lang.Object... params)
Returns the result of invoking this method on
target with
parameters params . |
boolean |
isPublic()
Returns true if this method is public, false if not
|
boolean |
isShadowedBy(FrameworkMethod other) |
boolean |
isStatic()
Returns true if this method is static, false if not
|
boolean |
producesType(java.lang.reflect.Type type)
Deprecated.
This is used only by the Theories runner, and does not
use all the generic type info that it ought to. It will be replaced
with a forthcoming ParameterSignature#canAcceptResultOf(FrameworkMethod)
once Theories moves to junit-contrib.
|
void |
validateNoTypeParametersOnArgs(java.util.List<java.lang.Throwable> errors) |
void |
validatePublicVoid(boolean isStatic,
java.util.List<java.lang.Throwable> errors)
Adds to
errors if this method:
is not public, or
returns something other than void, or
is static (given isStatic is false ), or
is not static (given isStatic is true ). |
void |
validatePublicVoidNoArg(boolean isStatic,
java.util.List<java.lang.Throwable> errors)
Adds to
errors if this method:
is not public, or
takes parameters, or
returns something other than void, or
is static (given isStatic is false ), or
is not static (given isStatic is true ). |
public FrameworkMethod(java.lang.reflect.Method method)
FrameworkMethod
for method
public java.lang.reflect.Method getMethod()
public java.lang.Object invokeExplosively(java.lang.Object target, java.lang.Object... params) throws java.lang.Throwable
target
with
parameters params
. InvocationTargetException
s thrown are
unwrapped, and their causes rethrown.java.lang.Throwable
public java.lang.String getName()
getName
in class FrameworkMember<FrameworkMethod>
public void validatePublicVoidNoArg(boolean isStatic, java.util.List<java.lang.Throwable> errors)
errors
if this method:
isStatic is false
), or
isStatic is true
).public void validatePublicVoid(boolean isStatic, java.util.List<java.lang.Throwable> errors)
errors
if this method:
isStatic is false
), or
isStatic is true
).public boolean isStatic()
isStatic
in class FrameworkMember<FrameworkMethod>
public boolean isPublic()
isPublic
in class FrameworkMember<FrameworkMethod>
public java.lang.Class<?> getReturnType()
public java.lang.Class<?> getType()
getType
in class FrameworkMember<FrameworkMethod>
public void validateNoTypeParametersOnArgs(java.util.List<java.lang.Throwable> errors)
public boolean isShadowedBy(FrameworkMethod other)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@Deprecated public boolean producesType(java.lang.reflect.Type type)
type
public java.lang.annotation.Annotation[] getAnnotations()
public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationType)
annotationType
on this method, if
one exists.