当前位置: 首页>>代码示例>>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;未经允许,请勿转载。