Package org.sonar.server.tester

Examples of org.sonar.server.tester.ServerTester$Xoo


    }
  }

  @Test
  public void register_existing_profile_definitions() throws Exception {
    tester = new ServerTester().addXoo().addComponents(XooRulesDefinition.class, XooProfileDefinition.class);
    tester.start();
    dbSession = dbClient().openSession(false);

    // Check Profile in DB
    QualityProfileDao qualityProfileDao = dbClient().qualityProfileDao();
View Full Code Here


  }

  @Test
  public void register_profile_definitions() throws Exception {
    tester = new ServerTester().addXoo().addComponents(XooRulesDefinition.class, XooProfileDefinition.class);
    tester.start();
    dbSession = dbClient().openSession(false);

    // Check Profile in DB
    QualityProfileDao qualityProfileDao = dbClient().qualityProfileDao();
View Full Code Here

    assertThat(params.get("max").getValue()).isEqualTo("10");
  }

  @Test
  public void fail_if_two_definitions_are_marked_as_default_on_the_same_language() throws Exception {
    tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("one", true), new SimpleProfileDefinition("two", true));

    try {
      tester.start();
    } catch (IllegalStateException e) {
      assertThat(e).hasMessage("Several Quality profiles are flagged as default for the language xoo: [one, two]");
View Full Code Here

    }
  }

  @Test
  public void mark_profile_as_default() throws Exception {
    tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("one", false), new SimpleProfileDefinition("two", true));

    tester.start();
    verifyProperty("sonar.profile.xoo", "two");
  }
View Full Code Here

    verifyProperty("sonar.profile.xoo", "two");
  }

  @Test
  public void use_sonar_way_as_default_profile_if_none_are_marked_as_default() throws Exception {
    tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("Sonar way", false), new SimpleProfileDefinition("Other way", false));

    tester.start();
    verifyProperty("sonar.profile.xoo", "Sonar way");
  }
View Full Code Here

    verifyProperty("sonar.profile.xoo", "Sonar way");
  }

  @Test
  public void fix_default_profile_if_invalid() throws Exception {
    tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("one", true));
    tester.start();

    PropertiesDao propertiesDao = dbClient().propertiesDao();
    propertiesDao.updateProperties("sonar.profile.xoo", "one", "invalid");
    // -> properties are corrupted. Default profile "invalid" does not exist
View Full Code Here

    verifyProperty("sonar.profile.xoo", "one");
  }

  @Test
  public void do_not_reset_default_profile_if_still_valid() throws Exception {
    tester = new ServerTester().addXoo().addComponents(new SimpleProfileDefinition("one", true), new SimpleProfileDefinition("two", false));
    tester.start();

    PropertiesDao propertiesDao = dbClient().propertiesDao();
    propertiesDao.updateProperties("sonar.profile.xoo", "one", "two");
    verifyProperty("sonar.profile.xoo", "two");
View Full Code Here

  /**
   * Probably for db migration
   */
  @Test
  public void clean_up_profiles_if_missing_loaded_template() throws Exception {
    tester = new ServerTester().addXoo().addComponents(XooRulesDefinition.class, XooProfileDefinition.class);
    tester.start();

    dbSession = dbClient().openSession(false);
    String templateKey = RegisterQualityProfiles.templateKey(new QProfileName("xoo", "Basic"));
    dbClient().loadedTemplateDao().delete(dbSession, LoadedTemplateDto.QUALITY_PROFILE_TYPE, templateKey);
View Full Code Here

TOP

Related Classes of org.sonar.server.tester.ServerTester$Xoo

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.