Package org.sonar.api.batch.rule

Examples of org.sonar.api.batch.rule.Rules.findAll()


  public void build_rules() throws Exception {
    setupData("shared");

    Rules rules = provider.provide(ruleDao, debtModel, durations);

    assertThat(rules.findAll()).hasSize(1);
    assertThat(rules.findByRepository("checkstyle")).hasSize(1);
    assertThat(rules.findByRepository("unknown")).isEmpty();

    Rule rule = rules.find(RuleKey.of("checkstyle", "AvoidNull"));
    assertThat(rule).isNotNull();
View Full Code Here


public class RulesBuilderTest {
  @Test
  public void no_rules() throws Exception {
    RulesBuilder builder = new RulesBuilder();
    Rules rules = builder.build();
    assertThat(rules.findAll()).isEmpty();
  }

  @Test
  public void build_rules() throws Exception {
    RulesBuilder builder = new RulesBuilder();
View Full Code Here

    builder.add(RuleKey.of("squid", "S0002"));
    builder.add(RuleKey.of("findbugs", "NPE"));

    Rules rules = builder.build();

    assertThat(rules.findAll()).hasSize(3);
    assertThat(rules.findByRepository("squid")).hasSize(2);
    assertThat(rules.findByRepository("findbugs")).hasSize(1);
    assertThat(rules.findByRepository("unknown")).isEmpty();

    Rule squid1 = rules.find(RuleKey.of("squid", "S0001"));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.