diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2019-09-03 15:36:13 +0200 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2019-09-05 10:03:19 +0200 |
commit | 3091d1bb8bfdb695942afdac41a5fa7c79a8ebc8 (patch) | |
tree | f3635ce9877ea9384b340d6f6adffee62b8d57ec /src/test/java/org/sonarsource/scanner/cli/ConfTest.java | |
parent | 7d253e8dc460e1858d5756211f0f16dafd724eae (diff) | |
download | sonar-scanner-cli-3091d1bb8bfdb695942afdac41a5fa7c79a8ebc8.tar.gz sonar-scanner-cli-3091d1bb8bfdb695942afdac41a5fa7c79a8ebc8.zip |
SQSCANNER-24 Always consider project.settings, if set
Diffstat (limited to 'src/test/java/org/sonarsource/scanner/cli/ConfTest.java')
-rw-r--r-- | src/test/java/org/sonarsource/scanner/cli/ConfTest.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java index 371a6ba..a966b50 100644 --- a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java @@ -301,4 +301,19 @@ public class ConfTest { Files.delete(linkProjectHome); } } + + // SQSCANNER-24 + @Test + public void should_load_project_settings_using_property() throws Exception { + Path home = Paths.get(getClass().getResource("ConfTest/shouldOverrideProjectSettingsPath/").toURI()); + args.setProperty("project.home", home.toAbsolutePath().toString()); + + Properties properties = conf.properties(); + assertThat(properties.get("sonar.prop")).isEqualTo("default"); + + args.setProperty("project.settings", home.resolve("conf/sq-project.properties").toAbsolutePath().toString()); + + properties = conf.properties(); + assertThat(properties.get("sonar.prop")).isEqualTo("expected"); + } } |