]> source.dussan.org Git - sonar-scanner-cli.git/commitdiff
SQSCANNER-37 Fix agent in network connections
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Tue, 28 Feb 2017 16:50:15 +0000 (17:50 +0100)
committerDuarte Meneses <duarte.meneses@sonarsource.com>
Wed, 1 Mar 2017 09:05:52 +0000 (10:05 +0100)
src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java
src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java

index 1a0af04ca9c3d6e1bb14188c2dca5935e243a622..04a6684d28c24ca097ebdd4b10f1738daaa78ff9 100644 (file)
@@ -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 {
index fc583a9d7f0c2b9c1eddb857c2abf0c9c170ff93..422a20ee7d9a02ecdab93ebaa3a15e5b6a731778 100644 (file)
@@ -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