public static Result runTestWithValidation(Class<?> test) {
    JUnitCore junitCore = new JUnitCore();
    Result result = junitCore.run(Request.aClass(test).getRunner());

    List<Failure> failures = result.getFailures();
    if (!failures.isEmpty()) {
      List<Throwable> errors = new ArrayList<>();
      for (Failure failure : failures) {
        errors.add(failure.getException());
      }
      try {
        MultipleFailureException.assertEmpty(errors);
      } catch (Exception e) {
        throw new AssertionError(e);
      }
    }

    assertThat(result.wasSuccessful()).isTrue();

    return result;
  }
Used by JUnit rule unit tests to execute inner test cases.
geode-junit/src/main/java/org/apache/geode/test/junit/runners/TestRunner.java