From c347e99a8b96cee0a14ed16e1cbd2e2fc65903b0 Mon Sep 17 00:00:00 2001 From: Mark Rekveld Date: Tue, 29 Sep 2020 10:47:08 +0200 Subject: SQSCANNER-44 - Move to Xoo for testing (#92) --- .../com/sonarsource/scanner/it/ScannerTest.java | 4 ++-- .../scanner/it/SonarScannerTestSuite.java | 21 ++++----------------- 2 files changed, 6 insertions(+), 19 deletions(-) (limited to 'it/src/test/java') diff --git a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java index abb7967..89e0d82 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java +++ b/it/src/test/java/com/sonarsource/scanner/it/ScannerTest.java @@ -215,10 +215,10 @@ public class ScannerTest extends ScannerTestCase { assertThat(getComponent("sample").getDescription()) .isEqualTo("This is a sample"); Map projectMeasures = getMeasures("sample", "files", - "ncloc", "classes", "violations"); + "ncloc", "violations"); assertThat(projectMeasures.values().stream() .filter(measure -> measure.getValue() != null) - .collect(Collectors.toList())).hasSize(4); + .collect(Collectors.toList())).hasSize(3); } @Test diff --git a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java index 232f43c..2ff3538 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java +++ b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java @@ -20,7 +20,6 @@ package com.sonarsource.scanner.it; import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.OrchestratorBuilder; import com.sonar.orchestrator.locator.MavenLocation; import org.junit.ClassRule; import org.junit.runner.RunWith; @@ -38,23 +37,11 @@ public class SonarScannerTestSuite { private static Orchestrator createOrchestrator() { String sonarVersion = System .getProperty("sonar.runtimeVersion", "LATEST_RELEASE[7.9]"); - OrchestratorBuilder builder = Orchestrator.builderEnv() + return Orchestrator.builderEnv() .setSonarVersion( - sonarVersion); - // The javascript language plugin needs to be installed to allow for - // tests to pass. If not installed test fail with a "no languages - // installed" error. - MavenLocation javascriptPlugin = MavenLocation - .of("org.sonarsource.javascript", "sonar-javascript-plugin", - "5.2.1.7778"); - // Since version 8.5 languages are bundled and located in a different - // location then other plugins. So install this in the correct location. - if (sonarVersion.startsWith("LATEST_RELEASE[7.9]")) { - builder.addPlugin(javascriptPlugin); - } else { - builder.addBundledPlugin(javascriptPlugin); - } - return builder.build(); + sonarVersion).addPlugin(MavenLocation + .of("org.sonarsource.sonarqube", "sonar-xoo-plugin", + sonarVersion)).build(); } } -- cgit v1.2.3