當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。