本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}