aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/Main.java1
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/MainTest.java12
2 files changed, 13 insertions, 0 deletions
diff --git a/src/main/java/org/sonarsource/scanner/cli/Main.java b/src/main/java/org/sonarsource/scanner/cli/Main.java
index 548caa3..7ea4f30 100644
--- a/src/main/java/org/sonarsource/scanner/cli/Main.java
+++ b/src/main/java/org/sonarsource/scanner/cli/Main.java
@@ -74,6 +74,7 @@ public class Main {
configureLogging(p);
init(p);
runner.start();
+ logger.info("SonarQube server " + runner.serverVersion());
if (cli.isInteractive()) {
interactiveLoop(p);
diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
index e2fd69c..1936ca8 100644
--- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
@@ -151,6 +151,18 @@ public class MainTest {
}
@Test
+ public void shouldLogServerVersion() throws IOException {
+ when(runner.serverVersion()).thenReturn("5.5");
+ Properties p = new Properties();
+ when(cli.isDisplayVersionOnly()).thenReturn(true);
+ when(conf.properties()).thenReturn(p);
+
+ Main main = new Main(shutdown, cli, conf, runnerFactory, logs);
+ main.execute();
+ verify(logs).info("SonarQube server 5.5");
+ }
+
+ @Test
public void should_configure_logging() throws IOException {
Properties p = new Properties();
p.put("sonar.verbose", "true");