aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2016-08-03 15:25:02 +0200
committerDuarte Meneses <duarte.meneses@sonarsource.com>2016-08-03 15:25:02 +0200
commitbc49ddf6f68e7b80dabad80c77e9db4bcb548f83 (patch)
treed723cf5e67bf794bd1be67b99e59bcf36483a831 /src
parentd1537d139b0034ac151969f221c98b2e57701e95 (diff)
downloadsonar-scanner-cli-bc49ddf6f68e7b80dabad80c77e9db4bcb548f83.tar.gz
sonar-scanner-cli-bc49ddf6f68e7b80dabad80c77e9db4bcb548f83.zip
Improve tests
Diffstat (limited to 'src')
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/ConfTest.java12
1 files changed, 12 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 506e01d..66e61e8 100644
--- a/src/test/java/org/sonarsource/scanner/cli/ConfTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/ConfTest.java
@@ -37,6 +37,7 @@ import org.apache.commons.lang.SystemUtils;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
public class ConfTest {
@@ -44,6 +45,9 @@ public class ConfTest {
@Rule
public TemporaryFolder temp = new TemporaryFolder();
+ @Rule
+ public ExpectedException exception = ExpectedException.none();
+
Map<String, String> env = new HashMap<>();
Properties args = new Properties();
Logs logs = new Logs(System.out, System.err);
@@ -132,6 +136,14 @@ public class ConfTest {
}
@Test
+ public void shouldFailWithInvalidEnvironmentProperties() throws IOException {
+ env.put("SONARQUBE_SCANNER_PARAMS", "{sonar.key1: \"v1\", \"sonar.key2\" : \"v2\"}");
+ exception.expect(IllegalStateException.class);
+ exception.expectMessage("JSON");
+ conf.properties();
+ }
+
+ @Test
public void shouldSupportDeepModuleConfigurationInRoot() throws Exception {
Path projectHome = Paths.get(getClass().getResource("ConfTest/shouldSupportDeepModuleConfigurationInRoot/project").toURI());
args.setProperty("project.home", projectHome.toAbsolutePath().toString());