summaryrefslogtreecommitdiffstats
path: root/src/test/java/org
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-09-07 10:21:17 +0200
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-09-07 10:21:17 +0200
commit9eb116afd392b896d1c68ddacb0330eeb207cfa1 (patch)
treeafe53124be9e1d25e773954363c3ceb91bc6542a /src/test/java/org
parent84cf7f1fb4491a955dcd6b4e10a9510f06666db8 (diff)
downloadsonar-scanner-cli-9eb116afd392b896d1c68ddacb0330eeb207cfa1.tar.gz
sonar-scanner-cli-9eb116afd392b896d1c68ddacb0330eeb207cfa1.zip
Allows to overwrite environment information on the Runner
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/sonar/runner/RunnerTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/java/org/sonar/runner/RunnerTest.java b/src/test/java/org/sonar/runner/RunnerTest.java
index abcd46d..c5b1b7b 100644
--- a/src/test/java/org/sonar/runner/RunnerTest.java
+++ b/src/test/java/org/sonar/runner/RunnerTest.java
@@ -38,6 +38,22 @@ public class RunnerTest {
public ExpectedException thrown = ExpectedException.none();
@Test
+ public void shouldHaveDefaultEnvironmentInformationValues() {
+ Runner runner = Runner.create(new Properties());
+ assertThat(runner.getProperties().getProperty(Runner.PROPERTY_ENVIRONMENT_INFORMATION_KEY)).isEqualTo("Runner");
+ assertThat(runner.getProperties().getProperty(Runner.PROPERTY_ENVIRONMENT_INFORMATION_VERSION)).contains(".");
+ assertThat(runner.getProperties().getProperty(Runner.PROPERTY_ENVIRONMENT_INFORMATION_VERSION)).doesNotContain("$");
+ }
+
+ @Test
+ public void shouldOverwriteDefaultEnvironmentInformationValues() {
+ Runner runner = Runner.create(new Properties());
+ runner.setEnvironmentInformation("Ant", "1.2.3");
+ assertThat(runner.getProperties().getProperty(Runner.PROPERTY_ENVIRONMENT_INFORMATION_KEY)).isEqualTo("Ant");
+ assertThat(runner.getProperties().getProperty(Runner.PROPERTY_ENVIRONMENT_INFORMATION_VERSION)).isEqualTo("1.2.3");
+ }
+
+ @Test
public void shouldCheckVersion() {
assertThat(Runner.isUnsupportedVersion("1.0")).isTrue();
assertThat(Runner.isUnsupportedVersion("2.0")).isTrue();