Examples of activateRule()


Examples of org.sonar.api.profiles.RulesProfile.activateRule()

   * SONAR-2900
   */
  @Test
  public void create_accept_objects() {
    RulesProfile profile = RulesProfile.create("repo", "java");
    ActiveRule activeRule = profile.activateRule(Rule.create("repo", "org.sonar.api.checks.CheckWithoutProperties", ""), null);
    CheckWithoutProperties checkInstance = new CheckWithoutProperties();
    AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(checkInstance));

    Object check = factory.getCheck(activeRule);
    assertNotNull(check);
View Full Code Here

Examples of org.sonar.api.profiles.RulesProfile.activateRule()

  public void create_instance_with_string_property() {
    RulesProfile profile = RulesProfile.create("repo", "java");
    Rule rule = Rule.create("repo", "org.sonar.api.checks.CheckWithStringProperty", "");
    rule.createParameter("pattern");

    ActiveRule activeRule = profile.activateRule(rule, null);
    activeRule.setParameter("pattern", "foo");
    CheckWithStringProperty checkInstance = new CheckWithStringProperty();
    AnnotationCheckFactory factory = AnnotationCheckFactory.create(profile, "repo", Arrays.asList(checkInstance));

    Object check = factory.getCheck(activeRule);
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.