@Override
 public int countTestCases() {
   if (mDelegate != null) {
     return mDelegate.countTestCases();
   } else {
     return 0;
   }
 }
Exemple #2
0
  @Override
  public int countTestCases() {
    List<Class> classes = myTestCaseLoader.getClasses();

    int count = 0;

    for (final Object aClass : classes) {
      Class testCaseClass = (Class) aClass;
      Test test = getTest(testCaseClass);
      if (test != null) count += test.countTestCases();
    }

    return count;
  }
Exemple #3
0
  private void runNextTest(final TestResult testResult, int totalTests, Class testCaseClass) {
    myRunTests++;
    if (!checkAvaliableMemory(35, testResult)) {
      testResult.stop();
      return;
    }
    if (testResult.errorCount() + testResult.failureCount() > MAX_FAILURE_TEST_COUNT) {
      addErrorMessage(
          testResult,
          "Too many errors. Tests stopped. Total "
              + myRunTests
              + " of "
              + totalTests
              + " tests run");
      testResult.stop();
      return;
    }
    if (myStartTime == 0) {
      boolean ourClassLoader =
          getClass().getClassLoader().getClass().getName().startsWith("com.intellij.");
      if (!ourClassLoader) {
        beforeFirstTest();
      }
    } else {
      if (myInterruptedByOutOfTime) {
        addErrorMessage(
            testResult,
            "Current Test Interrupted: OUT OF TIME! Class = "
                + myLastTestClass
                + " Total "
                + myRunTests
                + " of "
                + totalTests
                + " tests run");
        testResult.stop();
        return;
      }
    }

    log("\nRunning " + testCaseClass.getName());
    final Test test = getTest(testCaseClass);

    if (test == null) return;

    myLastTestClass = null;

    myLastTestClass = testCaseClass.getName();
    myLastTestStartTime = System.currentTimeMillis();
    myLastTestTestMethodCount = test.countTestCases();

    try {
      test.run(testResult);
    } catch (Throwable t) {
      if (t instanceof OutOfMemoryError) {
        if ((ourMode & SAVE_MEMORY_SNAPSHOT) != 0) {
          try {
            mySavingMemorySnapshot = true;
            log("OutOfMemoryError detected. Saving memory snapshot started");
          } finally {
            log("Saving memory snapshot finished");
            mySavingMemorySnapshot = false;
          }
        }
      }
      testResult.addError(test, t);
    }
  }
Exemple #4
0
 public int countTestCases() {
   return test.countTestCases();
 }
 public static Test buildComparableTestSuite(Class evaluationTestClass) {
   Test suite = buildMinimalComplianceTestSuite(evaluationTestClass, F_1_5);
   TESTS_COUNTERS.put(evaluationTestClass.getName(), new Integer(suite.countTestCases()));
   return suite;
 }