org.junit.Ignore#value ( )源码实例Demo

下面列出了org.junit.Ignore#value ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: consulo   文件: SMTestSender.java
private static void prepareIgnoreMessage(Description description, boolean commentMessage) {
  Map attrs = new HashMap();
  if (commentMessage) {
    try {
      final Ignore ignoredAnnotation = (Ignore)description.getAnnotation(Ignore.class);
      if (ignoredAnnotation != null) {
        final String val = ignoredAnnotation.value();
        if (val != null) {
          attrs.put("message", val);
        }
      }
    }
    catch (NoSuchMethodError ignored) {
      //junit < 4.4
    }
  }
  attrs.put("name", getMethodName(description));
  System.out.println(ServiceMessage.asString(ServiceMessageTypes.TEST_IGNORED, attrs));
}
 
源代码2 项目: ats-framework   文件: AtsJunitTestListener.java
/**
 *
 * @see org.junit.runner.notification.RunListener#testIgnored(org.junit.runner.Description)
 */
@Override
public void testIgnored( Description description ) throws Exception {
    
    if (!ActiveDbAppender.isAttached) {
        return;
    }

    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);
}
 
源代码3 项目: allure-cucumberjvm   文件: AllureRunListener.java
public String
getIgnoredMessage(Description description) {
    Ignore ignore = description.getAnnotation(Ignore.class
    );
    return ignore
            == null || ignore.value()
            .isEmpty() ? "Test ignored (without reason)!" : ignore.value();
}
 
源代码4 项目: marathonv5   文件: AllureMarathonRunListener.java
public String getIgnoredMessage(Description description) {
    Ignore ignore = description.getAnnotation(Ignore.class);
    return ignore == null || ignore.value().isEmpty() ? "Test ignored (without reason)!" : ignore.value();
}
 
源代码5 项目: allure-java   文件: AllureJunit4.java
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().setMessage(message);
}
 
源代码6 项目: allure1   文件: AllureRunListener.java
public String getIgnoredMessage(Description description) {
    Ignore ignore = description.getAnnotation(Ignore.class);
    return ignore == null || ignore.value().isEmpty() ? "Test ignored (without reason)!" : ignore.value();
}
 
 方法所在类
 同类方法