void (final TestResult testResult, int totalTests, Class<?> testCaseClass) { myRunTests++; int errorCount = testResult.errorCount(); int count = errorCount + testResult.failureCount() - myIgnoredTests; if (count > MAX_FAILURE_TEST_COUNT && MAX_FAILURE_TEST_COUNT >= 0) { addErrorMessage(testResult, "Too many errors (" + count + ", MAX_FAILURE_TEST_COUNT = " + MAX_FAILURE_TEST_COUNT + "). Executed: " + myRunTests + " of " + totalTests); testResult.stop(); return; } log("\nRunning " + testCaseClass.getName()); Test test = getTest(testCaseClass); if (test == null) return; try { test.run(testResult); } catch (Throwable t) { testResult.addError(test, t); } if (testResult.errorCount() > errorCount) { Enumeration<TestFailure> errors = testResult.errors(); while (errors.hasMoreElements()) { TestFailure failure = errors.nextElement(); if (errorCount-- > 0) continue; if (IgnoreException.isIgnoringThrowable(failure.thrownException())) { myIgnoredTests++; } } } }