diff options
author | Jacek <52388493+jacek-poreda-sonarsource@users.noreply.github.com> | 2019-08-01 15:08:41 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-08-01 20:21:14 +0200 |
commit | 1feb7a0ef4ff095b9712f891385207b60f4c2e6c (patch) | |
tree | bbd8e43e048f12d074e3138cf45a6399254761fe /sonar-scanner-engine | |
parent | bfb93726f012db0c0e7359ece193aae1fa30e00f (diff) | |
download | sonarqube-1feb7a0ef4ff095b9712f891385207b60f4c2e6c.tar.gz sonarqube-1feb7a0ef4ff095b9712f891385207b60f4c2e6c.zip |
Fix test to make it run on mac os (#1977)
* fix test to make it run on mac os
Diffstat (limited to 'sonar-scanner-engine')
-rw-r--r-- | sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/fs/FileSystemMediumTest.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/fs/FileSystemMediumTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/fs/FileSystemMediumTest.java index 29c09f7a81d..70b06029ef1 100644 --- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/fs/FileSystemMediumTest.java +++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/mediumtest/fs/FileSystemMediumTest.java @@ -36,12 +36,12 @@ import org.junit.rules.TemporaryFolder; import org.sonar.api.CoreProperties; import org.sonar.api.SonarEdition; import org.sonar.api.batch.fs.InputFile; +import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.api.utils.MessageException; import org.sonar.api.utils.PathUtils; import org.sonar.api.utils.System2; import org.sonar.api.utils.log.LogTester; import org.sonar.api.utils.log.LoggerLevel; -import org.sonar.api.batch.fs.internal.DefaultInputFile; import org.sonar.scanner.mediumtest.AnalysisResult; import org.sonar.scanner.mediumtest.ScannerMediumTester; import org.sonar.xoo.XooPlugin; @@ -823,7 +823,20 @@ public class FileSystemMediumTest { "xources/hello/helloscala.xoo", "testx/ClassOneTest.xoo.scm", "xources/hello/HelloJava.xoo"); - } else { // Other OS are case-sensitive so an exception should be thrown + } else if (System2.INSTANCE.isOsMac()) { + AnalysisResult result = analysis.execute(); + + assertThat(result.inputFiles()).hasSize(8); + assertThat(result.inputFiles()).extractingResultOf("relativePath").containsOnly( + "TESTX/ClassOneTest.xoo.measures", + "XOURCES/hello/helloscala.xoo.measures", + "XOURCES/hello/HelloJava.xoo.measures", + "TESTX/ClassOneTest.xoo", + "XOURCES/hello/HelloJava.xoo.scm", + "XOURCES/hello/helloscala.xoo", + "TESTX/ClassOneTest.xoo.scm", + "XOURCES/hello/HelloJava.xoo"); + } else { thrown.expect(MessageException.class); thrown.expectMessage("The folder 'TESTX' does not exist for 'sample'"); analysis.execute(); |