From: Duarte Meneses Date: Tue, 28 Feb 2017 16:50:15 +0000 (+0100) Subject: SQSCANNER-37 Fix agent in network connections X-Git-Tag: 2.9.0.670~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e95940e6698b9a79759616e73813ccdb3ba382d7;p=sonar-scanner-cli.git SQSCANNER-37 Fix agent in network connections --- diff --git a/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java b/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java index 1a0af04..04a6684 100644 --- a/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java +++ b/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java @@ -32,7 +32,9 @@ class ScannerFactory { } EmbeddedScanner create(Properties props) { - return EmbeddedScanner.create(new DefaultLogOutput()).addGlobalProperties(props); + return EmbeddedScanner.create(new DefaultLogOutput()) + .addGlobalProperties(props) + .setApp("ScannerCli", ScannerVersion.version()); } class DefaultLogOutput implements LogOutput { diff --git a/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java b/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java index fc583a9..422a20e 100644 --- a/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java +++ b/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java @@ -49,6 +49,8 @@ public class ScannerFactoryTest { assertThat(runner).isInstanceOf(EmbeddedScanner.class); assertThat(runner.globalProperties().get("foo")).isEqualTo("bar"); + assertThat(runner.app()).isEqualTo("ScannerCli"); + assertThat(runner.appVersion()).isNotNull(); } @Test