Package org.sonar.core.rule

Examples of org.sonar.core.rule.CacheRuleFinder


public class CacheRuleFinderTest extends AbstractDbUnitTestCase {

  @Test
  public void shouldCacheFindById() {
    setupData("shared");
    RuleFinder finder = new CacheRuleFinder(getSessionFactory());
    assertThat(finder.findById(3).getConfigKey(), is("Checker/Treewalker/AnnotationUseStyleCheck"));

    deleteRules();

    assertThat(finder.findById(3), notNullValue());
  }
View Full Code Here


  }

  @Test
  public void shouldNotFailIfUnknownRuleId() {
    setupData("shared");
    RuleFinder finder = new CacheRuleFinder(getSessionFactory());
    assertThat(finder.findById(33456816), nullValue());
  }
View Full Code Here

  }

  @Test
  public void shouldCacheFindByKey() {
    setupData("shared");
    RuleFinder finder = new CacheRuleFinder(getSessionFactory());
    Rule rule = finder.findByKey("checkstyle", "com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck");
    assertThat(rule.getConfigKey(), is("Checker/Treewalker/AnnotationUseStyleCheck"));

    deleteRules();

    rule = finder.findByKey("checkstyle", "com.puppycrawl.tools.checkstyle.checks.annotation.AnnotationUseStyleCheck");
    assertThat(rule, notNullValue());
  }
View Full Code Here

TOP

Related Classes of org.sonar.core.rule.CacheRuleFinder

Copyright © 2018 www.massapicom. 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.