Package org.sonar.core.qualityprofile.db

Examples of org.sonar.core.qualityprofile.db.QualityProfileDao


  public void feed_keys() throws Exception {
    db.prepareDbUnit(getClass(), "feed_keys.xml");

    new FeedQProfileKeysMigration(db.database()).execute();

    QualityProfileDao dao = new QualityProfileDao(db.myBatis(), mock(System2.class));

    QualityProfileDto parentProfile = dao.getById(10);
    assertThat(parentProfile.getKey()).startsWith("java-sonar-way-");
    assertThat(parentProfile.getName()).isEqualTo("Sonar Way");
    assertThat(parentProfile.getLanguage()).isEqualTo("java");
    assertThat(parentProfile.getParentKee()).isNull();

    QualityProfileDto differentCaseProfile = dao.getById(11);
    assertThat(differentCaseProfile.getKey()).startsWith("java-sonar-way-").isNotEqualTo(parentProfile.getKey());
    assertThat(differentCaseProfile.getName()).isEqualTo("Sonar way");
    assertThat(differentCaseProfile.getParentKee()).isNull();

    QualityProfileDto childProfile = dao.getById(12);
    assertThat(childProfile.getKey()).startsWith("java-child-");
    assertThat(childProfile.getName()).isEqualTo("Child");
    assertThat(childProfile.getParentKee()).isEqualTo(parentProfile.getKey());

    QualityProfileDto phpProfile = dao.getById(13);
    assertThat(phpProfile.getKey()).startsWith("php-sonar-way-");
    assertThat(phpProfile.getName()).isEqualTo("Sonar Way");
    assertThat(phpProfile.getLanguage()).isEqualTo("php");
    assertThat(phpProfile.getParentKee()).isNull();
  }
View Full Code Here


  @Before
  public void before() {
    system = mock(System2.class);
    when(system.now()).thenReturn(DATE1.getTime());
    RuleDao ruleDao = new RuleDao(system);
    ActiveRuleDao activeRuleDao = new ActiveRuleDao(new QualityProfileDao(getMyBatis(), system), ruleDao, system);
    dbClient = new DbClient(getDatabase(), getMyBatis(), ruleDao, activeRuleDao,
      new QualityProfileDao(getMyBatis(), system), new CharacteristicDao(getMyBatis()));
    dbSession = dbClient.openSession(false);
  }
View Full Code Here

  @Test
  public void facade() throws Exception {
    MyBatis myBatis = db.myBatis();
    RuleDao ruleDao = new RuleDao(System2.INSTANCE);
    QualityProfileDao qualityProfileDao = new QualityProfileDao(myBatis, System2.INSTANCE);
    ActiveRuleDao activeRuleDao = new ActiveRuleDao(qualityProfileDao, ruleDao, System2.INSTANCE);

    DbClient client = new DbClient(db.database(), myBatis, ruleDao, activeRuleDao, qualityProfileDao);

    assertThat(client.database()).isSameAs(db.database());
View Full Code Here

TOP

Related Classes of org.sonar.core.qualityprofile.db.QualityProfileDao

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.