コード例 #1
0
  private Method findPublicVoidMethod(Class<?> aClass, String methodName) {
    for (Method method : aClass.getDeclaredMethods()) {
      if (isPublic(method.getModifiers())
          && method.getReturnType() == void.class
          && methodName.equals(method.getName())) {
        return method;
      }
    }

    return null;
  }
コード例 #2
0
  private void reportTestAsNotApplicableInCurrentTestRun(Method method) {
    Class<?> testClass = method.getDeclaringClass();
    Description testDescription = Description.createTestDescription(testClass, method.getName());

    runNotifier.fireTestAssumptionFailed(new Failure(testDescription, NOT_APPLICABLE));
  }