本文整理了Java中org.sonar.api.rules.Rule.isEnabled
方法的一些代码示例,展示了Rule.isEnabled
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rule.isEnabled
方法的具体详情如下:
包路径:org.sonar.api.rules.Rule
类名称:Rule
方法名:isEnabled
暂无
代码示例来源:origin: SonarSource/sonarqube
/**
* @since 2.6
*/
public boolean isEnabled() {
return getRule() != null && getRule().isEnabled();
}
}
代码示例来源:origin: SonarSource/sonarqube
@Test
public void should_success_finder_wrap() {
// has Id
assertThat(underTest.findById(rule1.getId()).getId()).isEqualTo(rule1.getId());
// should_find_by_id
assertThat(underTest.findById(rule3.getId()).getConfigKey()).isEqualTo("Checker/Treewalker/AnnotationUseStyleCheck");
// should_not_find_disabled_rule_by_id
assertThat(underTest.findById(rule2.getId())).isNull();
// should_find_by_key
Rule rule = underTest.findByKey("checkstyle", "com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck");
assertThat(rule).isNotNull();
assertThat(rule.getKey()).isEqualTo(("com.puppycrawl.tools.checkstyle.checks.header.HeaderCheck"));
assertThat(rule.isEnabled()).isTrue();
// find_should_return_null_if_no_results
assertThat(underTest.findByKey("checkstyle", "unknown")).isNull();
assertThat(underTest.find(RuleQuery.create().withRepositoryKey("checkstyle").withConfigKey("unknown"))).isNull();
// find_repository_rules
assertThat(underTest.findAll(RuleQuery.create().withRepositoryKey("checkstyle"))).hasSize(2);
// find_all_enabled
assertThat(underTest.findAll(RuleQuery.create())).extracting("id").containsOnly(rule1.getId(), rule3.getId(), rule4.getId());
assertThat(underTest.findAll(RuleQuery.create())).hasSize(3);
// do_not_find_disabled_rules
assertThat(underTest.findByKey("checkstyle", "DisabledCheck")).isNull();
// do_not_find_unknown_rules
assertThat(underTest.findAll(RuleQuery.create().withRepositoryKey("unknown_repository"))).isEmpty();
}
代码示例来源:origin: org.codehaus.sonar/sonar-plugin-api
/**
* @since 2.6
*/
public boolean isEnabled() {
return getRule() != null && getRule().isEnabled();
}
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-plugin-api
/**
* @since 2.6
*/
public boolean isEnabled() {
return getRule() != null && getRule().isEnabled();
}
}
内容来源于网络,如有侵权,请联系作者删除!