本文整理汇总了Java中junit.framework.TestResult.shouldStop方法的典型用法代码示例。如果您正苦于以下问题:Java TestResult.shouldStop方法的具体用法?Java TestResult.shouldStop怎么用?Java TestResult.shouldStop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类junit.framework.TestResult
的用法示例。
在下文中一共展示了TestResult.shouldStop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import junit.framework.TestResult; //导入方法依赖的package包/类
/**
* Runs the tests and collects their result in a TestResult.
*/
@Override
public void run(TestResult result) {
try {
int testCount = countTestCases();
for (int i = 0; i < testCount; i++) {
// cleanupStores();
Test each = this.testAt(i);
if (result.shouldStop())
break;
runTest(each, result);
}
tearDown();
} catch (Exception e) {
throw new IllegalStateException(e);
}
}
示例2: run
import junit.framework.TestResult; //导入方法依赖的package包/类
@Override
public void run(TestResult result) {
for (int i = 0; i < fTimesRepeat; i++) {
if (result.shouldStop()) {
break;
}
super.run(result);
}
}
示例3: run
import junit.framework.TestResult; //导入方法依赖的package包/类
/**
* Runs the tests and collects their result in a TestResult.
*/
public void run(TestResult result) {
// Run tests
int i = 0;
while (fTests.size() != 0 && !result.shouldStop()) {
TestCase test = (TestCase)fTests.elementAt(i);
Thread.currentThread().setContextClassLoader(
test.getClass().getClassLoader());
test.run(result);
/*
if (fVictim != null) {
TestResult dummy = fVictim.run();
if (dummy.failureCount() != 0) {
result.addError(fTests.elementAt(i), new RuntimeException(
"Probable side effect",
((TestFailure)dummy.failures().nextElement()).
thrownException()));
} else if (dummy.errorCount() != 0) {
result.addError(fTests.elementAt(i), new RuntimeException(
"Probable side effect",
((TestFailure)dummy.errors().nextElement()).
thrownException()));
}
}
*/
fTests.remove(i);
if (fTests.size() != 0) {
i = (i + fStep - 1) % fTests.size();
}
}
// Forward overall stats to TestResult, so ResultPrinter can see it.
if (result instanceof CoreTestResult) {
((CoreTestResult)result).updateStats(
fTotalCount, fAndroidOnlyCount, fBrokenCount,
fKnownFailureCount, fNormalCount, fIgnoredCount,
fSideEffectCount);
}
}