本文整理汇总了Java中junit.framework.TestResult.failures方法的典型用法代码示例。如果您正苦于以下问题:Java TestResult.failures方法的具体用法?Java TestResult.failures怎么用?Java TestResult.failures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类junit.framework.TestResult
的用法示例。
在下文中一共展示了TestResult.failures方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import junit.framework.TestResult; //导入方法依赖的package包/类
public static void main(String[] argv) {
TestResult result = new TestResult();
TestCase testA = new TestMerge("testMerge1");
TestCase testB = new TestMerge("testMerge2");
TestCase testC = new TestMerge("testMerge3");
TestCase testD = new TestMerge("testMerge4");
TestCase testE = new TestMerge("testMerge5");
TestCase testF = new TestMerge("testMerge6");
TestCase testG = new TestMerge("testMerge7");
TestCase testH = new TestMerge("testMerge8");
TestCase testI = new TestMerge("testMerge9");
testA.run(result);
testB.run(result);
testC.run(result);
testD.run(result);
testE.run(result);
testF.run(result);
testG.run(result);
testH.run(result);
testI.run(result);
System.out.println("TestMerge error count: " + result.failureCount());
Enumeration e = result.failures();
while (e.hasMoreElements()) {
System.out.println(e.nextElement());
}
}
示例2: main
import junit.framework.TestResult; //导入方法依赖的package包/类
public static void main(String[] argv) {
TestResult result = new TestResult();
TestCase testKeepAlive = new TestHTTPKeepAlive("testKeepAlive");
testKeepAlive.run(result);
System.out.println("TestKeepAlive error count: "
+ result.failureCount());
Enumeration e = result.failures();
while (e.hasMoreElements()) {
System.out.println(e.nextElement());
}
}
示例3: main
import junit.framework.TestResult; //导入方法依赖的package包/类
public static void main(String[] argv) {
TestResult result = new TestResult();
TestCase testA = new TestMultiInsert("testMultiInsert");
testA.run(result);
System.out.println("TestMultiInsert error count: " + result.failureCount());
Enumeration e = result.failures();
while(e.hasMoreElements()) System.out.println(e.nextElement());
}
示例4: main
import junit.framework.TestResult; //导入方法依赖的package包/类
public static void main(String [] args) {
TestResult tr = new TestResult();
Test t = suite();
t.run(tr);
System.out.println(tr.errorCount());
Enumeration e = tr.failures();
while (e.hasMoreElements()) {
((TestFailure)e.nextElement ()).thrownException().printStackTrace();
}
System.out.println(tr.failureCount());
}
示例5: runWithResult
import junit.framework.TestResult; //导入方法依赖的package包/类
public void runWithResult() {
TestResult result = run();
String testName = this.getClass().getName();
if (testName.startsWith("org.hsqldb.test.")) {
testName = testName.substring(16);
}
testName += "." + getName();
int failureCount = result.failureCount();
System.out.println(testName + " failure count: " + failureCount);
java.util.Enumeration failures = result.failures();
while (failures.hasMoreElements()) {
System.err.println(failures.nextElement());
}
}