/**
  * Runs the tests and collects their result in a TestResult.
  *
  * <p>We must override this method in order to run against JUnit4 which doesn't invoke tests().
  */
 public void run(TestResult result) {
   for (Enumeration e = tests(); e.hasMoreElements(); ) {
     Test each = (Test) e.nextElement();
     if (result.shouldStop()) break;
     runTest(each, result);
   }
 }
Exemple #2
0
 @Override
 public void run(TestResult result) {
   for (int i = 0; i < fTimesRepeat; i++) {
     if (result.shouldStop()) break;
     super.run(result);
   }
 }
  /** Runs the tests and collects their result in a TestResult. */
  public void run(TestResult result) {
    // it probably make some sense to call result.run(this),
    // but, to avoid the suite being counted we try/catch ourselves
    try {
      setUp();
    } catch (AssertionFailedError e) {
      result.addFailure(this, e);
      return;
    } catch (ThreadDeath e) { // don't catch ThreadDeath by accident
      throw e;
    } catch (Throwable e) {
      result.addError(this, e);
      return;
    }

    for (Enumeration e = tests(); e.hasMoreElements(); ) {
      if (result.shouldStop()) break;
      Test test = (Test) e.nextElement();
      runTest(test, result);
    }

    try {
      tearDown();
    } catch (AssertionFailedError e) {
      result.addFailure(this, e);
      return;
    } catch (ThreadDeath e) { // don't catch ThreadDeath by accident
      throw e;
    } catch (Throwable e) {
      result.addError(this, e);
      return;
    }
  }
Exemple #4
0
 @Override
 public void run(final TestResult testResult) {
   List<Class> classes = myTestCaseLoader.getClasses();
   int totalTests = classes.size();
   for (final Class aClass : classes) {
     runNextTest(testResult, totalTests, aClass);
     if (testResult.shouldStop()) break;
   }
   tryGc(10);
 }