aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-08-07 09:41:40 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-08-07 09:41:40 +0200
commitd320d2738d590e608c0e1eb32ae848634672149f (patch)
treeeb7393a031fb9ef61df0a5616577bdcce9d958b2
parent8507e6b93988f0d70f26042f48707455af0889d2 (diff)
downloadsonarqube-d320d2738d590e608c0e1eb32ae848634672149f.tar.gz
sonarqube-d320d2738d590e608c0e1eb32ae848634672149f.zip
Fix test when test env declares some system properties starting with "sonar."
-rw-r--r--sonar-application/src/test/java/org/sonar/application/CommandLineParserTest.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/sonar-application/src/test/java/org/sonar/application/CommandLineParserTest.java b/sonar-application/src/test/java/org/sonar/application/CommandLineParserTest.java
index d7eb444e59b..bc40a48acc8 100644
--- a/sonar-application/src/test/java/org/sonar/application/CommandLineParserTest.java
+++ b/sonar-application/src/test/java/org/sonar/application/CommandLineParserTest.java
@@ -36,7 +36,10 @@ public class CommandLineParserTest {
System.setProperty("sonar.CommandLineParserTest.used", "used");
Properties p = parser.parseArguments(new String[] {"-Dsonar.foo=bar"});
- assertThat(p).hasSize(2);
+
+ // test environment can already declare some system properties prefixed by "sonar."
+ // so we can't test the exact number "2"
+ assertThat(p.size()).isGreaterThanOrEqualTo(2);
assertThat(p.getProperty("sonar.foo")).isEqualTo("bar");
assertThat(p.getProperty("sonar.CommandLineParserTest.used")).isEqualTo("used");