コード例 #1
0
  void runTestMethod(Statement methodInvoker, RunNotifier notifier) {
    Description methodDescription = describeMethod();
    Description methodWithParams = findChildForParams(methodInvoker, methodDescription);

    notifier.fireTestStarted(methodWithParams);
    runMethodInvoker(notifier, methodDescription, methodInvoker, methodWithParams);
    notifier.fireTestFinished(methodWithParams);
  }
コード例 #2
0
 private void runMethodInvoker(
     RunNotifier notifier,
     Description description,
     Statement methodInvoker,
     Description methodWithParams) {
   try {
     methodInvoker.evaluate();
   } catch (Throwable e) {
     notifier.fireTestFailure(new Failure(methodWithParams, e));
   }
 }
コード例 #3
0
  private void reportTestAsNotApplicableInCurrentTestRun(Method method) {
    Class<?> testClass = method.getDeclaringClass();
    Description testDescription = Description.createTestDescription(testClass, method.getName());

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