diff options
author | Michal Duda <michal.duda@sonarsource.com> | 2019-02-01 12:51:32 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-02-18 20:20:55 +0100 |
commit | 2b8cc73a602be586c15754f7d87242dbaa5ccfd7 (patch) | |
tree | 9e0a974b045fa96f97fed0ea2620ddccf4545743 /sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java | |
parent | e89a888d560520c69f01e45fc5c9649e76fba30d (diff) | |
download | sonarqube-2b8cc73a602be586c15754f7d87242dbaa5ccfd7.tar.gz sonarqube-2b8cc73a602be586c15754f7d87242dbaa5ccfd7.zip |
SONARCLOUD-336: Automatically guess the projectKey/organization
Diffstat (limited to 'sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java index 3583ac85f34..5de2170fd3c 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/GlobalTempFolderProviderTest.java @@ -51,7 +51,8 @@ public class GlobalTempFolderProviderTest { File workingDir = temp.newFolder(); workingDir.delete(); - TempFolder tempFolder = tempFolderProvider.provide(new ScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath()))); + TempFolder tempFolder = tempFolderProvider.provide( + new RawScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath()))); tempFolder.newDir(); tempFolder.newFile(); assertThat(getCreatedTempDir(workingDir)).exists(); @@ -71,7 +72,8 @@ public class GlobalTempFolderProviderTest { setFileCreationDate(tmp, creationTime); } - tempFolderProvider.provide(new ScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath()))); + tempFolderProvider.provide( + new RawScannerProperties(ImmutableMap.of(CoreProperties.GLOBAL_WORKING_DIRECTORY, workingDir.getAbsolutePath()))); // this also checks that all other temps were deleted assertThat(getCreatedTempDir(workingDir)).exists(); @@ -84,7 +86,8 @@ public class GlobalTempFolderProviderTest { File sonarHome = temp.newFolder(); File workingDir = new File(sonarHome, CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE).getAbsoluteFile(); - TempFolder tempFolder = tempFolderProvider.provide(new ScannerProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath()))); + TempFolder tempFolder = tempFolderProvider.provide( + new RawScannerProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath()))); tempFolder.newDir(); tempFolder.newFile(); assertThat(getCreatedTempDir(workingDir)).exists(); @@ -106,7 +109,8 @@ public class GlobalTempFolderProviderTest { File defaultSonarHome = new File(userHome.getAbsolutePath(), ".sonar"); File workingDir = new File(defaultSonarHome, CoreProperties.GLOBAL_WORKING_DIRECTORY_DEFAULT_VALUE).getAbsoluteFile(); try { - TempFolder tempFolder = tempFolderProvider.provide(new ScannerProperties(Collections.<String, String>emptyMap())); + TempFolder tempFolder = tempFolderProvider.provide( + new RawScannerProperties(Collections.emptyMap())); tempFolder.newDir(); tempFolder.newFile(); assertThat(getCreatedTempDir(workingDir)).exists(); @@ -120,8 +124,8 @@ public class GlobalTempFolderProviderTest { public void dotWorkingDir() throws IOException { File sonarHome = temp.getRoot(); String globalWorkDir = "."; - ScannerProperties globalProperties = new ScannerProperties(ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath(), - CoreProperties.GLOBAL_WORKING_DIRECTORY, globalWorkDir)); + RawScannerProperties globalProperties = new RawScannerProperties( + ImmutableMap.of("sonar.userHome", sonarHome.getAbsolutePath(), CoreProperties.GLOBAL_WORKING_DIRECTORY, globalWorkDir)); TempFolder tempFolder = tempFolderProvider.provide(globalProperties); File newFile = tempFolder.newFile(); @@ -136,7 +140,7 @@ public class GlobalTempFolderProviderTest { File symlink = temp.newFolder(); symlink.delete(); Files.createSymbolicLink(symlink.toPath(), realSonarHome.toPath()); - ScannerProperties globalProperties = new ScannerProperties(ImmutableMap.of("sonar.userHome", symlink.getAbsolutePath())); + RawScannerProperties globalProperties = new RawScannerProperties(ImmutableMap.of("sonar.userHome", symlink.getAbsolutePath())); TempFolder tempFolder = tempFolderProvider.provide(globalProperties); File newFile = tempFolder.newFile(); |