コード例 #1
0
  private boolean verifyTestMethodsInJUnit38TestClassThatShouldRun(JUnit38ClassRunner runner) {
    Description testClassDescription = runner.getDescription();
    Class<?> testClass = testClassDescription.getTestClass();
    Iterator<Description> itr = testClassDescription.getChildren().iterator();

    while (itr.hasNext()) {
      Description testDescription = itr.next();
      String testMethodName = testDescription.getMethodName();
      testMethod = findPublicVoidMethod(testClass, testMethodName);

      Boolean shouldRun = shouldRunTestInCurrentTestRun(null, testMethod);

      if (shouldRun != null && !shouldRun) {
        itr.remove();
      }
    }

    return testClassDescription.getChildren().isEmpty();
  }