aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src/test
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2017-03-02 13:10:07 +0100
committerJulien HENRY <henryju@yahoo.fr>2017-03-02 16:24:43 +0100
commitea8d74d2617e334ffbf827ec29a6accb8a7c1cfc (patch)
treef606efb068dafe590df4209d3de47dbc5e5df250 /sonar-scanner-engine/src/test
parentbec1de9fc1f6c8bdd9a463dd3c514703f8b7f273 (diff)
downloadsonarqube-ea8d74d2617e334ffbf827ec29a6accb8a7c1cfc.tar.gz
sonarqube-ea8d74d2617e334ffbf827ec29a6accb8a7c1cfc.zip
SONAR-8883 Fix Server::getVersion() on scanner side, and reenable IssueJsonReportTest IT
Diffstat (limited to 'sonar-scanner-engine/src/test')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/platform/DefaultServerTest.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/platform/DefaultServerTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/platform/DefaultServerTest.java
index 3c6df76e498..47a09228471 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/platform/DefaultServerTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/platform/DefaultServerTest.java
@@ -21,8 +21,11 @@ package org.sonar.scanner.platform;
import org.junit.Test;
import org.sonar.api.CoreProperties;
-import org.sonar.api.config.Settings;
+import org.sonar.api.SonarQubeSide;
import org.sonar.api.config.MapSettings;
+import org.sonar.api.config.Settings;
+import org.sonar.api.internal.SonarRuntimeImpl;
+import org.sonar.api.utils.Version;
import org.sonar.scanner.bootstrap.ScannerWsClient;
import static org.assertj.core.api.Assertions.assertThat;
@@ -35,13 +38,12 @@ public class DefaultServerTest {
public void shouldLoadServerProperties() {
Settings settings = new MapSettings();
settings.setProperty(CoreProperties.SERVER_ID, "123");
- settings.setProperty(CoreProperties.SERVER_VERSION, "2.2");
settings.setProperty(CoreProperties.SERVER_STARTTIME, "2010-05-18T17:59:00+0000");
settings.setProperty(CoreProperties.PERMANENT_SERVER_ID, "abcde");
ScannerWsClient client = mock(ScannerWsClient.class);
when(client.baseUrl()).thenReturn("http://foo.com");
- DefaultServer metadata = new DefaultServer(settings, client);
+ DefaultServer metadata = new DefaultServer(settings, client, SonarRuntimeImpl.forSonarQube(Version.parse("2.2"), SonarQubeSide.SCANNER));
assertThat(metadata.getId()).isEqualTo("123");
assertThat(metadata.getVersion()).isEqualTo("2.2");
@@ -61,7 +63,7 @@ public class DefaultServerTest {
Settings settings = new MapSettings();
ScannerWsClient client = mock(ScannerWsClient.class);
when(client.baseUrl()).thenReturn("http://foo.com/");
- DefaultServer metadata = new DefaultServer(settings, client);
+ DefaultServer metadata = new DefaultServer(settings, client, null);
settings.setProperty(CoreProperties.SERVER_BASE_URL, "http://server.com/");
assertThat(metadata.getPublicRootUrl()).isEqualTo("http://server.com");
@@ -75,7 +77,7 @@ public class DefaultServerTest {
Settings settings = new MapSettings();
settings.setProperty(CoreProperties.SERVER_STARTTIME, "invalid");
ScannerWsClient client = mock(ScannerWsClient.class);
- DefaultServer metadata = new DefaultServer(settings, client);
+ DefaultServer metadata = new DefaultServer(settings, client, null);
metadata.getStartedAt();
}
}