当前位置: 首页>>代码示例>>Java>>正文


Java TestSuite.addTestSuite方法代码示例

本文整理汇总了Java中junit.framework.TestSuite.addTestSuite方法的典型用法代码示例。如果您正苦于以下问题:Java TestSuite.addTestSuite方法的具体用法?Java TestSuite.addTestSuite怎么用?Java TestSuite.addTestSuite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在junit.framework.TestSuite的用法示例。


在下文中一共展示了TestSuite.addTestSuite方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: suite

import junit.framework.TestSuite; //导入方法依赖的package包/类
/** Executes the execution compatibility kit tests on the provided instance
 * of execution engine.
 */
public static Test suite(ExecutionEngine engine) {
    System.setProperty("org.openide.util.Lookup", ExecutionCompatibilityTest.class.getName() + "$Lkp");
    Object o = Lookup.getDefault();
    if (!(o instanceof Lkp)) {
        Assert.fail("Wrong lookup object: " + o);
    }
    
    Lkp l = (Lkp)o;
    l.assignExecutionEngine(engine);
    
    if (engine != null) {
        Assert.assertEquals("Same engine found", engine, ExecutionEngine.getDefault());
    } else {
        o = ExecutionEngine.getDefault();
        Assert.assertNotNull("Engine found", o);
        Assert.assertEquals(ExecutionEngine.Trivial.class, o.getClass());
    }
    
    TestSuite ts = new TestSuite();
    ts.addTestSuite(ExecutionEngineHid.class);
    
    return ts;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:ExecutionCompatibilityTest.java

示例2: suite

import junit.framework.TestSuite; //导入方法依赖的package包/类
public static TestSuite suite() {
        TestSuite result = new NbTestSuite();

        result.addTestSuite(BatchSearchTest.class);
//        result.addTest(new BatchSearchTest("testBatchSearchFolderRemoteIndex"));

        return result;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:BatchSearchTest.java

示例3: suite

import junit.framework.TestSuite; //导入方法依赖的package包/类
public static Test suite() {
		TestSuite clientSuite = new TestSuite("Basic Storage ServerTest-Suite");
		clientSuite.addTestSuite(ConnectionTest.class);
		clientSuite.addTestSuite(InteractionTest.class); 
//		clientSuite.addTestSuite(AdditionalTest.class); 
		return clientSuite;
	}
 
开发者ID:yanghanxy,项目名称:CloudDB,代码行数:8,代码来源:AllTests.java

示例4: buildTestSuite

import junit.framework.TestSuite; //导入方法依赖的package包/类
/**
 * Build a TestSuite of all the tests contained in the
 * jar file.
 * @return TestSuite for running all of the tests in the jar file
 */
public TestSuite buildTestSuite() throws Exception {
	TestSuite suite = new TestSuite();

	ArrayList<URL> urlList = new ArrayList<URL>();
	urlList.add(new URL("file:" + jarFileName));
	if (classpath != null) {
		StringTokenizer tok = new StringTokenizer(classpath, File.pathSeparator);
		while (tok.hasMoreTokens()) {
			urlList.add(new URL("file:" + tok.nextToken()));
		}
	}

	ClassLoader cl = new URLClassLoader(urlList.toArray(new URL[0]));

	Class testCaseClass = cl.loadClass("junit.framework.TestCase");

	JarFile jarFile = new JarFile(jarFileName);
	Enumeration e = jarFile.entries();
	while (e.hasMoreElements()) {
		JarEntry entry = (JarEntry) e.nextElement();
		String entryName = entry.getName();
		if (entryName.endsWith(".class")) {
			String className =
				entryName.substring(0, entryName.length() - ".class".length()).replace('/', '.');
			if (!className.endsWith("Test"))
				continue;
			System.out.println("Loading test class: " + className);
			System.out.flush();
			Class jarClass = cl.loadClass(className);
			if (testCaseClass.isAssignableFrom(jarClass))
				suite.addTestSuite(jarClass);
		}
	}

	return suite;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:42,代码来源:JUnitJarRunner.java

示例5: suite

import junit.framework.TestSuite; //导入方法依赖的package包/类
/**
 * Required by JUnit
 */
public static TestSuite suite() {
  final TestSuite testSuite = new TestSuite();
  final LocalAgentEnvironment environment = new LocalAgentEnvironment();
  if (environment.isWindows()) testSuite.addTestSuite(SSTestVSSCommand.class);
  return testSuite;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:SSTestVSSCommand.java


注:本文中的junit.framework.TestSuite.addTestSuite方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。