use of org.sonar.scanner.bootstrap.GlobalProperties in project sonarqube by SonarSource.
the class GlobalModeTest method createMode.
private GlobalMode createMode(String key, String value) {
Map<String, String> map = new HashMap<>();
if (key != null) {
map.put(key, value);
}
GlobalProperties props = new GlobalProperties(map);
return new GlobalMode(props);
}
use of org.sonar.scanner.bootstrap.GlobalProperties in project sonarqube by SonarSource.
the class ProjectSettingsTest method prepare.
@Before
public void prepare() {
emptyFileData = ImmutableTable.of();
emptySettings = ImmutableTable.of();
project = ProjectDefinition.create().setKey("struts");
globalMode = mock(GlobalMode.class);
mode = mock(DefaultAnalysisMode.class);
bootstrapProps = new GlobalSettings(new GlobalProperties(Collections.<String, String>emptyMap()), new PropertyDefinitions(), mock(SettingsLoader.class), globalMode);
}
use of org.sonar.scanner.bootstrap.GlobalProperties in project sonarqube by SonarSource.
the class GlobalTempFolderProviderTest method dotWorkingDir.
@Test
public void dotWorkingDir() throws IOException {
File sonarHome = temp.getRoot();
String globalWorkDir = ".";
GlobalProperties globalProperties = new GlobalProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath(), CoreProperties.GLOBAL_WORKING_DIRECTORY, globalWorkDir));
TempFolder tempFolder = tempFolderProvider.provide(globalProperties);
File newFile = tempFolder.newFile();
assertThat(newFile.getParentFile().getParentFile().getAbsolutePath()).isEqualTo(sonarHome.getAbsolutePath());
assertThat(newFile.getParentFile().getName()).startsWith(".sonartmp_");
}
use of org.sonar.scanner.bootstrap.GlobalProperties in project sonarqube by SonarSource.
the class GlobalTempFolderProviderTest method createTempFolderProps.
@Test
public void createTempFolderProps() throws Exception {
File workingDir = temp.newFolder();
TempFolder tempFolder = tempFolderProvider.provide(new GlobalProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath())));
tempFolder.newDir();
tempFolder.newFile();
assertThat(getCreatedTempDir(workingDir)).exists();
assertThat(getCreatedTempDir(workingDir).list()).hasSize(2);
FileUtils.deleteQuietly(workingDir);
}
use of org.sonar.scanner.bootstrap.GlobalProperties in project sonarqube by SonarSource.
the class GlobalPropertiesTest method test_copy_of_properties.
@Test
public void test_copy_of_properties() {
Map<String, String> map = Maps.newHashMap();
map.put("foo", "bar");
GlobalProperties wrapper = new GlobalProperties(map);
assertThat(wrapper.properties()).containsOnly(entry("foo", "bar"));
assertThat(wrapper.properties()).isNotSameAs(map);
map.put("put", "after_copy");
assertThat(wrapper.properties()).hasSize(1);
}
Aggregations