public class

FrameworkMethod

extends Object
java.lang.Object
   ↳ org.junit.runners.model.FrameworkMethod

Class Overview

Represents a method on a test class to be invoked at the appropriate point in test execution. These methods are usually marked with an annotation (such as @Test, @Before, @After, @BeforeClass, @AfterClass, etc.)

Summary

Public Constructors
FrameworkMethod(Method method)
Returns a new FrameworkMethod for method
Public Methods
boolean equals(Object obj)
<T extends Annotation> T 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
int hashCode()
Object invokeExplosively(Object target, Object... params)
Returns the result of invoking this method on target with parameters params.
boolean isShadowedBy(FrameworkMethod other)
boolean producesType(Class<?> type)
Returns true iff this is a no-arg method that returns a value assignable to type
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).
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FrameworkMethod (Method method)

Returns a new FrameworkMethod for method

Public Methods

public boolean equals (Object obj)

public T getAnnotation (Class<T> annotationType)

Returns the annotation of type annotationType on this method, if one exists.

public Annotation[] getAnnotations ()

Returns the annotations on this method

public Method getMethod ()

Returns the underlying Java method

public String getName ()

Returns the method's name

public int hashCode ()

public Object invokeExplosively (Object target, Object... params)

Returns the result of invoking this method on target with parameters params. InvocationTargetExceptions thrown are unwrapped, and their causes rethrown.

Throws
Throwable

public boolean isShadowedBy (FrameworkMethod other)

public boolean producesType (Class<?> type)

Returns true iff this is a no-arg method that returns a value assignable to type

public 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).

public 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).