Lines Matching refs:method

12  * Represents a method on a test class to be invoked at the appropriate point in
20 private final Method method;
23 * Returns a new {@code FrameworkMethod} for {@code method}
25 public FrameworkMethod(Method method) {
26 if (method == null) {
28 "FrameworkMethod cannot be created without an underlying method.");
30 this.method = method;
34 * Returns the underlying Java method
37 return method;
41 * Returns the result of invoking this method on {@code target} with
50 return method.invoke(target, params);
56 * Returns the method's name
60 return method.getName();
64 * Adds to {@code errors} if this method:
75 if (method.getParameterTypes().length != 0) {
76 errors.add(new Exception("Method " + method.getName() + " should have no parameters"));
82 * Adds to {@code errors} if this method:
93 errors.add(new Exception("Method " + method.getName() + "() " + state + " be static"));
96 errors.add(new Exception("Method " + method.getName() + "() should be public"));
98 if (method.getReturnType() != Void.TYPE) {
99 errors.add(new Exception("Method " + method.getName() + "() should be void"));
105 return method.getModifiers();
109 * Returns the return type of the method
112 return method.getReturnType();
116 * Returns the return type of the method
124 * Returns the class where the method is actually declared
128 return method.getDeclaringClass();
132 new NoGenericTypeParametersValidator(method).validate(errors);
156 return ((FrameworkMethod) obj).method.equals(method);
161 return method.hashCode();
165 * Returns true if this is a no-arg method that returns a value assignable
176 && ((Class<?>) type).isAssignableFrom(method.getReturnType());
180 return method.getParameterTypes();
184 * Returns the annotations on this method
187 return method.getAnnotations();
191 * Returns the annotation of type {@code annotationType} on this method, if
195 return method.getAnnotation(annotationType);
200 return method.toString();