當前位置: 首頁>>代碼示例>>Java>>正文


Java Result.getRunCount方法代碼示例

本文整理匯總了Java中org.junit.runner.Result.getRunCount方法的典型用法代碼示例。如果您正苦於以下問題:Java Result.getRunCount方法的具體用法?Java Result.getRunCount怎麽用?Java Result.getRunCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.junit.runner.Result的用法示例。


在下文中一共展示了Result.getRunCount方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: runTestSuiteAgainst

import org.junit.runner.Result; //導入方法依賴的package包/類
/**
 * Creates and runs a JUnit test runner for testSuite.
 *
 * @param testSuite the class defining test cases to run
 * @param view a UI component to report test failures to
 * @return the counts of failures and total test cases.
 */
static RunResult runTestSuiteAgainst(Class testSuite, View view)
{
    if(testSuite == null)
        throw new NullPointerException("testSuite");

    if(view == null)
        throw new NullPointerException("view");

    Result result = new JUnitCore().run(testSuite);

    if (result.getFailureCount() > 0)
    {
        for (Failure f : result.getFailures())
            view.declarePassProgramTestFailure(f.getTrace());
    }


    return new RunResult(result.getFailureCount(), result.getRunCount());
}
 
開發者ID:capergroup,項目名稱:bayou,代碼行數:27,代碼來源:TestSuiteRunner.java

示例2: merge

import org.junit.runner.Result; //導入方法依賴的package包/類
/**
 * Updates the current state of <code>this</code> with the <code>result</code>.
 *
 * @param testClass The test class executed.
 * @param result The results of the test class execution.
 * @return <code>this</code>
 */
public TestResults merge(Class<?> testClass, Result result) {
  LOG.info("Tests run: {}, Failures: {}, Skipped: {}, Time elapsed: {} - in {}",
      result.getRunCount(), result.getFailureCount(), result.getIgnoreCount(),
      TimeUnit.SECONDS.convert(result.getRunTime(), TimeUnit.MILLISECONDS),
      testClass.getName());

  numRun += result.getRunCount();
  numFailed += result.getFailureCount();
  numIgnored += result.getIgnoreCount();

  // Collect the failures
  if (!result.wasSuccessful()) {
    failures.addAll(result.getFailures());
  }

  return this;
}
 
開發者ID:apache,項目名稱:calcite-avatica,代碼行數:25,代碼來源:TestRunner.java

示例3: TestResult

import org.junit.runner.Result; //導入方法依賴的package包/類
public TestResult(Result result) {
    runCount = result.getRunCount();
    failureCount = result.getFailureCount();
    ignoreCount = result.getIgnoreCount();
    runTime = result.getRunTime();
    if (!wasSuccessful()) {
        throwable = result.getFailures().get(0).getException();
    }
}
 
開發者ID:blackboard,項目名稱:lambda-selenium,代碼行數:10,代碼來源:TestResult.java


注:本文中的org.junit.runner.Result.getRunCount方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。