Package org.sonar.api.config

Examples of org.sonar.api.config.PropertyDefinitions


  @Test
  public void should_not_fail_when_accessing_secured_properties() {
    projectRef.addSettings("struts", ImmutableMap.of("sonar.foo.secured", "bar", "sonar.foo.license.secured", "bar2"));

    ProjectSettings batchSettings = new ProjectSettings(new ProjectReactor(project), bootstrapProps, new PropertyDefinitions(), projectRef, mode);

    assertThat(batchSettings.getString("sonar.foo.license.secured")).isEqualTo("bar2");
    assertThat(batchSettings.getString("sonar.foo.secured")).isEqualTo("bar");
  }
View Full Code Here


  public void should_fail_when_accessing_secured_properties_in_dryrun() {
    projectRef.addSettings("struts", ImmutableMap.of("sonar.foo.secured", "bar", "sonar.foo.license.secured", "bar2"));

    when(mode.isPreview()).thenReturn(true);

    ProjectSettings batchSettings = new ProjectSettings(new ProjectReactor(project), bootstrapProps, new PropertyDefinitions(), projectRef, mode);

    assertThat(batchSettings.getString("sonar.foo.license.secured")).isEqualTo("bar2");
    thrown.expect(MessageException.class);
    thrown
      .expectMessage("Access to the secured property 'sonar.foo.secured' is not possible in preview mode. The SonarQube plugin which requires this property must be deactivated in preview mode.");
View Full Code Here

  }

  @Test
  public void test_loading_of_module_settings() {
    GlobalSettings batchSettings = mock(GlobalSettings.class);
    when(batchSettings.getDefinitions()).thenReturn(new PropertyDefinitions());
    when(batchSettings.getProperties()).thenReturn(ImmutableMap.of(
      "overridding", "batch",
      "on-batch", "true"
      ));
    projectRef.addSettings("struts-core", ImmutableMap.of("on-module", "true", "overridding", "module"));
View Full Code Here

  }

  @Test
  public void should_not_fail_when_accessing_secured_properties() {
    GlobalSettings batchSettings = mock(GlobalSettings.class);
    when(batchSettings.getDefinitions()).thenReturn(new PropertyDefinitions());
    when(batchSettings.getProperties()).thenReturn(ImmutableMap.of(
      "sonar.foo.secured", "bar"
      ));
    projectRef.addSettings("struts-core", ImmutableMap.of("sonar.foo.license.secured", "bar2"));
View Full Code Here

  }

  @Test
  public void should_fail_when_accessing_secured_properties_in_preview() {
    GlobalSettings batchSettings = mock(GlobalSettings.class);
    when(batchSettings.getDefinitions()).thenReturn(new PropertyDefinitions());
    when(batchSettings.getProperties()).thenReturn(ImmutableMap.of(
      "sonar.foo.secured", "bar"
      ));
    projectRef.addSettings("struts-core", ImmutableMap.of("sonar.foo.license.secured", "bar2"));
View Full Code Here

    parentContainer = new ComponentContainer();
    parentContainer.add(System2.INSTANCE);
    parentContainer.add(bootstrapProperties);
    parentContainer.add(analysisMode);
    GlobalReferentials globalRef = new GlobalReferentials();
    settings = new GlobalSettings(bootstrapProperties, new PropertyDefinitions(), globalRef, analysisMode);
    parentContainer.add(settings);
    ProjectReferentialsLoader projectReferentialsLoader = new ProjectReferentialsLoader() {
      @Override
      public ProjectReferentials load(ProjectReactor reactor, TaskProperties taskProperties) {
        return new ProjectReferentials();
View Full Code Here

  }

  @Test
  public void testAllParams() {
    CommandExecutor commandExecutor = mock(CommandExecutor.class);
    Settings settings = new Settings(new PropertyDefinitions(SvnConfiguration.getProperties()));
    SvnBlameCommand svnBlameCommand = new SvnBlameCommand(commandExecutor, new SvnConfiguration(settings));

    Command commandLine = svnBlameCommand.createCommandLine(baseDir, "src/main/java/Foo.java");
    assertThat(commandLine.toCommandLine()).isEqualTo("svn blame --xml --non-interactive -x -w src/main/java/Foo.java");
    assertThat(commandLine.toString()).isEqualTo("svn blame --xml --non-interactive -x -w src/main/java/Foo.java");
View Full Code Here

  @Test
  public void selectImplem() {
    GitBlameCommand blameCommand = new GitBlameCommand();
    JGitBlameCommand jblameCommand = new JGitBlameCommand(new PathResolver());
    Settings settings = new Settings(new PropertyDefinitions(new GitPlugin().getExtensions()));
    GitScmProvider gitScmProvider = new GitScmProvider(settings, blameCommand, jblameCommand);

    assertThat(gitScmProvider.blameCommand()).isEqualTo(jblameCommand);

    settings.setProperty(GitPlugin.GIT_IMPLEMENTATION_PROP_KEY, GitPlugin.EXE);
View Full Code Here

public class RenameDeprecatedPropertyKeysTest {
  @Test
  public void should_rename_deprecated_keys() {
    PropertiesDao dao = mock(PropertiesDao.class);
    PropertyDefinitions definitions = new PropertyDefinitions(FakeExtension.class);
    RenameDeprecatedPropertyKeys task = new RenameDeprecatedPropertyKeys(dao, definitions);
    task.start();

    verify(dao).renamePropertyKey("old_key", "new_key");
    verifyNoMoreInteractions(dao);
View Full Code Here

  public void before() throws Exception {
    properties = new Properties();
    properties.put("hello", "world");
    properties.put("in_file", "true");
    properties.put("ServerSettingsTestEnv", "in_file");
    settings = new ServerSettings(new PropertyDefinitions(), properties);
  }
View Full Code Here

TOP

Related Classes of org.sonar.api.config.PropertyDefinitions

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.