public class FrameworkMethod extends FrameworkMember<FrameworkMethod>
@Test, @Before, @After, @BeforeClass,
@AfterClass, etc.)| Constructor and Description |
|---|
FrameworkMethod(Method method)
Returns a new
FrameworkMethod for method |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
<T extends Annotation> |
getAnnotation(Class<T> annotationType)
Returns the annotation of type
annotationType on this method, if
one exists. |
Annotation[] |
getAnnotations()
Returns the annotations on this method
|
Method |
getMethod()
Returns the underlying Java method
|
String |
getName()
Returns the method's name
|
Class<?> |
getReturnType()
Returns the return type of the method
|
Class<?> |
getType()
Returns the return type of the method
|
int |
hashCode() |
Object |
invokeExplosively(Object target,
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(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(List<Throwable> errors) |
void |
validatePublicVoid(boolean isStatic,
List<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,
List<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(Method method)
FrameworkMethod for methodpublic Method getMethod()
public Object invokeExplosively(Object target, Object... params) throws Throwable
target with
parameters params. InvocationTargetExceptions thrown are
unwrapped, and their causes rethrown.Throwablepublic String getName()
getName in class FrameworkMember<FrameworkMethod>public void validatePublicVoidNoArg(boolean isStatic,
List<Throwable> errors)
errors if this method:
isStatic is false), or
isStatic is true).public void validatePublicVoid(boolean isStatic,
List<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 Class<?> getReturnType()
public Class<?> getType()
getType in class FrameworkMember<FrameworkMethod>public boolean isShadowedBy(FrameworkMethod other)
@Deprecated public boolean producesType(Type type)
typepublic Annotation[] getAnnotations()
public <T extends Annotation> T getAnnotation(Class<T> annotationType)
annotationType on this method, if
one exists.