本文整理匯總了Java中org.junit.Ignore.value方法的典型用法代碼示例。如果您正苦於以下問題:Java Ignore.value方法的具體用法?Java Ignore.value怎麽用?Java Ignore.value使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.junit.Ignore
的用法示例。
在下文中一共展示了Ignore.value方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testIgnored
import org.junit.Ignore; //導入方法依賴的package包/類
/**
*
* @see org.junit.runner.notification.RunListener#testIgnored(org.junit.runner.Description)
*/
@Override
public void testIgnored( Description description ) throws Exception {
if (log.isDebugEnabled()) {
log.info("testIgnored(): description: " + description.getDisplayName() + "| is test: "
+ description.isTest() + "| test class: " + description.getClassName()
+ "| test method: " + description.getMethodName() + "| children: 0? =>"
+ description.getChildren());
}
// manually invoking testStarted()
testStarted(description);
String ignoreDetails = "";
Ignore ignoreAnnotation = getMethod(description).getAnnotation(Ignore.class);
if (ignoreAnnotation != null) {
ignoreDetails = ignoreAnnotation.value();
}
if (ignoreDetails.isEmpty()) {
logger.info(MSG__TEST_IGNORED);
} else {
logger.info(MSG__TEST_IGNORED + " Details: " + ignoreDetails);
}
//open a performance test scenario and test case
logger.endTestcase(TestCaseResult.SKIPPED);
sendTestEndEventToAgents();
super.testIgnored(description);
}
示例2: getIgnoredMessage
import org.junit.Ignore; //導入方法依賴的package包/類
public String getIgnoredMessage(Description description) {
Ignore ignore = description.getAnnotation(Ignore.class);
return ignore == null || ignore.value().isEmpty() ? "Test ignored (without reason)!" : ignore.value();
}
示例3: getIgnoredMessage
import org.junit.Ignore; //導入方法依賴的package包/類
private StatusDetails getIgnoredMessage(final Description description) {
final Ignore ignore = description.getAnnotation(Ignore.class);
final String message = Objects.nonNull(ignore) && !ignore.value().isEmpty()
? ignore.value() : "Test ignored (without reason)!";
return new StatusDetails().withMessage(message);
}