本文整理匯總了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);
}
}