本文整理匯總了Java中org.junit.runner.notification.Failure.getDescription方法的典型用法代碼示例。如果您正苦於以下問題:Java Failure.getDescription方法的具體用法?Java Failure.getDescription怎麽用?Java Failure.getDescription使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.junit.runner.notification.Failure
的用法示例。
在下文中一共展示了Failure.getDescription方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isKnownIssue
import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
private boolean isKnownIssue(Failure failure) {
if (failure == null) {
return false;
}
if (failure.getDescription() == null) {
return false;
}
final KnownIssue knownIssue = failure.getDescription().getAnnotation(KnownIssue.class);
final String message = failure.getMessage();
if (knownIssue == null || message == null || knownIssue.value() == null) {
return false;
}
if (message.contains(knownIssue.value())) {
return true;
}
return false;
}
示例2: executionFailed
import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
/** Mark execution of given {@link Description} as failed. Parent descriptions may be updated accordingly. */
public void executionFailed(Failure failure) {
Description description = failure.getDescription();
allStatuses.put(description, ExecutionStatus.FAILED);
allFailures.put(description, failure);
updateParents(description, ExecutionStatus.FAILED);
}
示例3: testAssumptionFailure
import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
public void testAssumptionFailure(Failure failure) {
final Description description = failure.getDescription();
try {
testFailure(failure, description, MapSerializerUtil.TEST_IGNORED, true);
}
catch (Exception ignore) {}
}
示例4: testFailure
import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
public synchronized void testFailure(Failure failure) throws Exception {
final Description description = failure.getDescription();
final Throwable throwable = failure.getException();
final Throwable cause = throwable.getCause();
if (ComparisonFailureData.isAssertionError(throwable.getClass()) ||
ComparisonFailureData.isAssertionError(cause != null ? cause.getClass() : null)) {
// junit4 makes no distinction between errors and failures
doAddFailure(description, throwable);
}
else {
prepareDefectPacket(description, throwable).send();
}
}
示例5: formFailureDescription
import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
private static String formFailureDescription(Failure failure) {
return failure.getMessage() + " " +failure.getDescription() + " " + failure.getException().getMessage();
}
示例6: testAssumptionFailure
import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
public void testAssumptionFailure(Failure failure) {
final Description description = failure.getDescription();
prepareIgnoredPacket(description, null).addThrowable(failure.getException()).send();
}