]> source.dussan.org Git - sonarqube.git/commitdiff
Enable ITs with commercial plugins
authorDuarte Meneses <duarte.meneses@sonarsource.com>
Thu, 14 Dec 2017 12:53:05 +0000 (13:53 +0100)
committerDuarte Meneses <duarte.meneses@sonarsource.com>
Fri, 15 Dec 2017 08:39:30 +0000 (09:39 +0100)
tests/pom.xml
tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java

index 3937b0c2fa17f5e934997d229c746201f172717a..d8b9e7b886d1e2e52c570b13920f4aea6e313c3c 100644 (file)
   </properties>
 
   <dependencies>
+   <!-- This is just to force Maven to download it in local repository -->
+    <dependency>
+      <groupId>com.sonarsource.license</groupId>
+      <artifactId>sonar-dev-license-plugin</artifactId>
+      <!-- Should be the same version than in Orchestrator builder in your test suite -->
+      <version>3.2.0.1163</version>
+      <scope>runtime</scope>
+    </dependency>
     <dependency>
       <!-- required for selenide -->
       <groupId>com.google.guava</groupId>
index 6df8891ca56d9ac4c7bd6a8ec37ff8c68cff60b0..3db73c7a75f6b13211640de9885efa8a745029f0 100644 (file)
  */
 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<String> LICENSED_PLUGINS = Sets.newHashSet(
-    "abap", "cobol", "cpp", "objc", "pli", "plsql", "rpg",
-    "swift", "vb", "vbnet");
-
   private static final List<Check> 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));
-  }
 }