當前位置: 首頁>>代碼示例>>Java>>正文


Java Failure.getMessage方法代碼示例

本文整理匯總了Java中org.junit.runner.notification.Failure.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java Failure.getMessage方法的具體用法?Java Failure.getMessage怎麽用?Java Failure.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.junit.runner.notification.Failure的用法示例。


在下文中一共展示了Failure.getMessage方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
	}
 
開發者ID:xtf-cz,項目名稱:xtf,代碼行數:24,代碼來源:IntermediateReporter.java

示例2: testFailure

import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
@Override
public void testFailure(Failure failure) throws Exception {
  if (failure != null && failure.getMessage() != null 
      && failure.getMessage().startsWith(TEST_TIMED_OUT_PREFIX)) {
    output.println("====> TEST TIMED OUT. PRINTING THREAD DUMP. <====");
    output.println();
    output.print(buildThreadDiagnosticString());
  }
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:10,代碼來源:TimedOutTestsListener.java

示例3: formFailureDescription

import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
private static String formFailureDescription(Failure failure) {
    return failure.getMessage() + " " +failure.getDescription() + " " + failure.getException().getMessage();
}
 
開發者ID:SeriyBg,項目名稱:junit-easy-tools,代碼行數:4,代碼來源:ResultAssertions.java

示例4: testFailure

import org.junit.runner.notification.Failure; //導入方法依賴的package包/類
@Override
public void testFailure(Failure failure) throws Exception {
	if (working) {
		if (failure.getDescription().getMethodName() == null) {
			// before class failed
			for (Description child : failure.getDescription().getChildren()) {
				// mark all methods failed
				testFailure(new Failure(child, failure.getException()));
			}
		} else {
			// normal failure
			Element testcase = createTestCase(failure.getDescription());

			Element element;
			if (failure.getException() instanceof AssertionError) {

				if (isKnownIssue(failure)) {
					ignored.incrementAndGet();
					element = xml.createElement("skipped");
				}
				else {
					failures.incrementAndGet();
					element = xml.createElement("failure");
				}
			} else {
				errors.incrementAndGet();
				element = xml.createElement("error");
			}

			testcase.appendChild(element);

			final String message;
			if (isSinceVersion(failure)) {
				message = prependSinceVersionJira(failure, failure.getMessage());
			}
			else {
				message = failure.getMessage();
			}

			element.setAttribute("type", safeString(failure.getException().getClass().getName()));
			element.setAttribute("message", safeString(message));
			element.appendChild(xml.createCDATASection(safeString(failure.getTrace())));

			testsuite.get().appendChild(testcase);
			writeXml();
		}
	}
}
 
開發者ID:xtf-cz,項目名稱:xtf,代碼行數:49,代碼來源:IntermediateReporter.java


注:本文中的org.junit.runner.notification.Failure.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。