当前位置: 首页>>代码示例>>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;未经允许,请勿转载。