aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2016-08-23 14:44:56 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2016-08-23 14:44:56 +0200
commit1a6e5d814b671a123916226d1025a328f4e9da25 (patch)
tree7baebdd00e69f51bb9c0dd5233481edb092125d0 /src/test/java/org
parent4e62271c74a2346ba9d8d42d16916874a0fde5bc (diff)
downloadsonar-scanner-cli-1a6e5d814b671a123916226d1025a328f4e9da25.tar.gz
sonar-scanner-cli-1a6e5d814b671a123916226d1025a328f4e9da25.zip
Improve test coverage
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/ConfTest.java20
1 files changed, 20 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 66e61e8..4b11a07 100644
--- a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java
@@ -232,6 +232,26 @@ public class ConfTest {
}
@Test
+ public void failModuleBaseDirDoesNotExist() throws IOException {
+ args.setProperty("sonar.modules", "module1");
+ args.setProperty("module1.sonar.projectBaseDir", "invalid");
+
+ exception.expect(IllegalStateException.class);
+ exception.expectMessage("The base directory of the module 'module1' does not exist");
+ conf.properties();
+ }
+
+ @Test
+ public void failModulePropertyFileDoesNotExist() throws IOException {
+ args.setProperty("sonar.modules", "module1");
+ args.setProperty("module1.sonar.projectConfigFile", "invalid");
+
+ exception.expect(IllegalStateException.class);
+ exception.expectMessage("The properties file of the module 'module1' does not exist");
+ conf.properties();
+ }
+
+ @Test
public void shouldSupportSettingBaseDirFromCli() throws Exception {
Path projectHome = Paths.get(getClass().getResource("ConfTest/shouldLoadModuleConfiguration/project").toURI());
args.setProperty("project.home", temp.newFolder().getCanonicalPath());