From: Duarte Meneses Date: Thu, 14 Dec 2017 12:53:05 +0000 (+0100) Subject: Enable ITs with commercial plugins X-Git-Tag: 7.0-RC1~103 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=090c2183e379ad52500727038e3bab72d74e0dfa;p=sonarqube.git Enable ITs with commercial plugins --- diff --git a/tests/pom.xml b/tests/pom.xml index 3937b0c2fa1..d8b9e7b886d 100644 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -28,6 +28,14 @@ + + + com.sonarsource.license + sonar-dev-license-plugin + + 3.2.0.1163 + runtime + com.google.guava diff --git a/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java b/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java index 6df8891ca56..3db73c7a75f 100644 --- a/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java +++ b/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java @@ -19,29 +19,34 @@ */ package org.sonarqube.tests.plugins; -import com.google.common.collect.Sets; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.OrchestratorBuilder; import com.sonar.orchestrator.build.BuildResult; import com.sonar.orchestrator.build.SonarScanner; -import com.sonar.orchestrator.locator.URLLocation; +import com.sonar.orchestrator.locator.MavenLocation; import java.io.File; import java.net.MalformedURLException; -import java.net.URL; import java.util.Arrays; import java.util.List; -import java.util.Set; import org.junit.BeforeClass; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ErrorCollector; +import org.sonarqube.tests.plugins.checks.AbapCheck; +import org.sonarqube.tests.plugins.checks.CCheck; import org.sonarqube.tests.plugins.checks.Check; +import org.sonarqube.tests.plugins.checks.CobolCheck; +import org.sonarqube.tests.plugins.checks.CppCheck; import org.sonarqube.tests.plugins.checks.FlexCheck; import org.sonarqube.tests.plugins.checks.GroovyCheck; import org.sonarqube.tests.plugins.checks.JavaCheck; import org.sonarqube.tests.plugins.checks.JavascriptCheck; import org.sonarqube.tests.plugins.checks.PhpCheck; +import org.sonarqube.tests.plugins.checks.PliCheck; +import org.sonarqube.tests.plugins.checks.PlsqlCheck; import org.sonarqube.tests.plugins.checks.PythonCheck; +import org.sonarqube.tests.plugins.checks.RpgCheck; +import org.sonarqube.tests.plugins.checks.SwiftCheck; import org.sonarqube.tests.plugins.checks.Validation; import org.sonarqube.tests.plugins.checks.WebCheck; @@ -54,14 +59,10 @@ import static org.assertj.core.api.Assertions.fail; */ public class PluginsTest { - private static final Set LICENSED_PLUGINS = Sets.newHashSet( - "abap", "cobol", "cpp", "objc", "pli", "plsql", "rpg", - "swift", "vb", "vbnet"); - private static final List CHECKS = Arrays.asList( - // FIXME plsql is disabled as latest release is not using new license manager new AbapCheck(), - // FIXME cpp is disabled as latest release is not using new license manager new CCheck(), new CppCheck(), - // FIXME cobol is disabled as latest release is not using new license manager new CobolCheck(), + new AbapCheck(), + new CCheck(), new CppCheck(), + new CobolCheck(), // FIXME css plugin is temporary disabled as for the moment incompatible with the web plugin // new CssCheck(), new FlexCheck(), @@ -69,11 +70,11 @@ public class PluginsTest { new JavaCheck(), new JavascriptCheck(), new PhpCheck(), - // FIXME pli is disabled as latest release is not using new license manager new PliCheck(), - // FIXME plsql is disabled as latest release is not using new license manager new PlsqlCheck(), + new PliCheck(), + new PlsqlCheck(), new PythonCheck(), - // FIXME rpg is disabled as latest release is not using new license manager new RpgCheck(), - // FIXME swift is disabled as latest release is not using new license manager new SwiftCheck(), + new RpgCheck(), + new SwiftCheck(), // SONAR-7618 Visual Basic 2.2 not compatible with CE not loading @ServerSide // new VbCheck(), new WebCheck()); @@ -85,18 +86,20 @@ public class PluginsTest { OrchestratorBuilder builder = Orchestrator.builderEnv() .setZipFile(byWildcardMavenFilename(new File("../sonar-application/target"), "sonar*.zip").getFile()); + builder.addPlugin(MavenLocation.of("com.sonarsource.license", "sonar-dev-license-plugin", "3.2.0.1163")); + // FIXME JSON plugin is temporarily disabled as for the moment the github repo doesn't exist anymore installPlugin(builder, "JSON");; installPlugin(builder, "Sonargraph"); - // FIXME abap is disabled as latest release is not using new license manager installPlugin(builder, "abap"); + installPlugin(builder, "abap"); // FIXME AEM Rules plugin is disabled because it is no more compatible with SonarQube 6.4 (ClassNotFoundException: com.google.common.base.Functions) installPlugin(builder, "aemrules"); installPlugin(builder, "android"); installPlugin(builder, "authbitbucket"); installPlugin(builder, "authgithub"); installPlugin(builder, "checkstyle"); installPlugin(builder, "clover"); - // FIXME cobol is disabled as latest release is not using new license manager installPlugin(builder, "cobol"); + installPlugin(builder, "cobol"); installPlugin(builder, "codecrackercsharp"); - // FIXME cpp is disabled as latest release is not using new license manager installPlugin(builder, "cpp"); + installPlugin(builder, "cpp"); installPlugin(builder, "csharp"); // FIXME css plugin is temporarily disabled as for the moment incompatible with the web plugin installPlugin(builder, "css"); // FIXME erlang plugin is temporarily disabled because it is not compatible with SQ 6.4 until usage of Colorizer API is removed @@ -123,15 +126,13 @@ public class PluginsTest { installPlugin(builder, "lua"); installPlugin(builder, "php"); installPlugin(builder, "pitest"); - // SONAR-7618 SonarPLI release 1.5.0.702 not compatible with CE not loading @ServerSide. To be reset to LATEST_RELEASE as soon as SonarPLI 1.5.1 is released. - // FIXME pli is disabled as latest release is not using new license manager installPlugin(builder, new URL("https://sonarsource.bintray.com/CommercialDistribution/sonar-pli-plugin/sonar-pli-plugin-1.5.1.872.jar")); - // SONAR-7618 SonarPLSQL 2.9.0.901 not compatible with CE not loading @ServerSide. To be reset to LATEST_RELEASE as soon as SonarPLSQL 2.9.1 is released. - // FIXME plsql is disabled as latest release is not using new license manager installPlugin(builder, new URL("https://sonarsource.bintray.com/CommercialDistribution/sonar-plsql-plugin/sonar-plsql-plugin-2.9.1.1051.jar")); + installPlugin(builder, "pli"); + installPlugin(builder, "plsql"); installPlugin(builder, "pmd"); // FIXME puppet plugin is temporarily disabled because it is not compatible with SQ 6.4 until usage of Colorizer API is removed installPlugin(builder, "python"); installPlugin(builder, "rci"); - // FIXME rpg is disabled as latest release is not using new license manager installPlugin(builder, "rpg"); + installPlugin(builder, "rpg"); installPlugin(builder, "scmclearcase"); installPlugin(builder, "scmcvs"); installPlugin(builder, "scmgit"); @@ -143,10 +144,9 @@ public class PluginsTest { installPlugin(builder, "softvis3d"); installPlugin(builder, "sonargraphintegration"); installPlugin(builder, "status"); - // FIXME swift is disabled as latest release is not using new license manager installPlugin(builder, "swift"); - // SONAR-7618 Visual Basic 2.2 not compatible with CE not loading @ServerSide - // installPlugin(builder, "vb"); - // FIXME vbnet is disabled as latest release is not using new license manager installPlugin(builder, "vbnet"); + installPlugin(builder, "swift"); + // SONAR-7618 Visual Basic 2.2 not compatible with CE not loading @ServerSide installPlugin(builder, "vb"); + installPlugin(builder, "vbnet"); installPlugin(builder, "web"); installPlugin(builder, "xanitizer"); installPlugin(builder, "xml"); @@ -191,15 +191,11 @@ public class PluginsTest { } private static void activateLicenses(OrchestratorBuilder builder) { - LICENSED_PLUGINS.forEach(builder::activateLicense); + builder.activateLicense(); } private static void installPlugin(OrchestratorBuilder builder, String pluginKey) { builder.setOrchestratorProperty(pluginKey + "Version", "LATEST_RELEASE"); builder.addPlugin(pluginKey); } - - private static void installPlugin(OrchestratorBuilder builder, URL url) { - builder.addPlugin(URLLocation.create(url)); - } }