Package org.sonar.batch.bootstrap

Examples of org.sonar.batch.bootstrap.GlobalSettings


  @Before
  public void prepare() {
    projectRef = new ProjectReferentials();
    mode = mock(AnalysisMode.class);
    bootstrapProps = new GlobalSettings(new BootstrapProperties(Collections.<String, String>emptyMap()), new PropertyDefinitions(), new GlobalReferentials(), mode);
  }
View Full Code Here


    assertThat(hierarchy.get(2)).isEqualTo(child);
  }

  @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"));

    ProjectDefinition module = ProjectDefinition.create().setKey("struts-core");
View Full Code Here

    assertThat(moduleSettings.getString("sonar.foo.secured")).isEqualTo("bar");
  }

  @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"));

    when(mode.isPreview()).thenReturn(true);
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

TOP

Related Classes of org.sonar.batch.bootstrap.GlobalSettings

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.