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


Java TestSuite.tests方法代碼示例

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


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

示例1: iterateTests

import junit.framework.TestSuite; //導入方法依賴的package包/類
private void iterateTests(TestResult result, StringBuffer times, TestSuite suite, AtomicLong min, AtomicLong max) {
    Enumeration en = suite.tests();
    while (en.hasMoreElements()) {
        Test t = (Test)en.nextElement();
        if (t instanceof Callable) {
            try {
                Long v = (Long)((Callable) t).call();
                long time = v.longValue();
                if (time < min.longValue()) {
                    min.set(time);
                }
                if (time > max.longValue()) {
                    max.set(time);
                }
                // append(t.toString()).append(" value: ")
                times.append("Run: ").append(v).append('\n');
            } catch (Exception ex) {
                result.addError(this, ex);
            }
        }
        if (t instanceof TestSuite) {
            iterateTests(result, times, (TestSuite)t, min, max);
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:26,代碼來源:ExpandFolderTest.java

示例2: collectTests

import junit.framework.TestSuite; //導入方法依賴的package包/類
private static void collectTests(Test test, ArrayList<Object[]> tests) {
    if (test instanceof TestSuite) {
        TestSuite suite = (TestSuite) test;
        Enumeration<Test> tests2 = suite.tests();
        while (tests2.hasMoreElements()) {
            Test test2 = tests2.nextElement();
            collectTests(test2, tests);
        }
    } else {
        String name;
        if (test instanceof IHasFullname) {
            name = ((IHasFullname) test).getFullName();
        } else {
            name = ((TestCase) test).getName();
        }
        tests.add(new Object[] { test, name });
    }
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:19,代碼來源:MarathonTestProvider.java

示例3: makeSuiteForTesterClass

import junit.framework.TestSuite; //導入方法依賴的package包/類
protected TestSuite makeSuiteForTesterClass(Class<? extends AbstractTester<?>> testerClass) {
  final TestSuite candidateTests = new TestSuite(testerClass);
  final TestSuite suite = filterSuite(candidateTests);

  Enumeration<?> allTests = suite.tests();
  while (allTests.hasMoreElements()) {
    Object test = allTests.nextElement();
    if (test instanceof AbstractTester) {
      @SuppressWarnings("unchecked")
      AbstractTester<? super G> tester = (AbstractTester<? super G>) test;
      tester.init(subjectGenerator, name, setUp, tearDown);
    }
  }

  return suite;
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:17,代碼來源:FeatureSpecificTestSuiteBuilder.java

示例4: filterSuite

import junit.framework.TestSuite; //導入方法依賴的package包/類
private TestSuite filterSuite(TestSuite suite) {
  TestSuite filtered = new TestSuite(suite.getName());
  final Enumeration<?> tests = suite.tests();
  while (tests.hasMoreElements()) {
    Test test = (Test) tests.nextElement();
    if (matches(test)) {
      filtered.addTest(test);
    }
  }
  return filtered;
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:12,代碼來源:FeatureSpecificTestSuiteBuilder.java

示例5: createExampleSuite

import junit.framework.TestSuite; //導入方法依賴的package包/類
@GwtIncompatible // suite sub call
private static TestSuite createExampleSuite(ListExample example) {
  TestSuite resultSuite = new TestSuite(ListsImplTest.class);
  for (Enumeration<Test> testEnum = resultSuite.tests(); testEnum.hasMoreElements();) {
    ListsImplTest test = (ListsImplTest) testEnum.nextElement();
    test.example = example;
  }
  return resultSuite;
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:10,代碼來源:ListsImplTest.java


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