aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2017-07-05 11:14:58 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2017-07-05 16:51:11 +0200
commitfd4e7efe96826908cf443fb567e89e8dc2e6dd51 (patch)
treebf4df5c91d8efd71872d39238a4bb3bcf68471ce
parent44023b33d97d874e79ecd11efe745f004063e8b7 (diff)
downloadsonarqube-fd4e7efe96826908cf443fb567e89e8dc2e6dd51.tar.gz
sonarqube-fd4e7efe96826908cf443fb567e89e8dc2e6dd51.zip
Re-enable and complete PLI and PLSQL tests
-rw-r--r--tests/projects/plugins/project/src/plsql/has-issues.sql9
-rw-r--r--tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java22
-rw-r--r--tests/src/test/java/org/sonarqube/tests/plugins/checks/PlsqlCheck.java34
3 files changed, 58 insertions, 7 deletions
diff --git a/tests/projects/plugins/project/src/plsql/has-issues.sql b/tests/projects/plugins/project/src/plsql/has-issues.sql
new file mode 100644
index 00000000000..29a74b1d962
--- /dev/null
+++ b/tests/projects/plugins/project/src/plsql/has-issues.sql
@@ -0,0 +1,9 @@
+-- plsql:SingleLineCommentsSyntaxCheck
+/* single line comment */
+
+-- plsql:UpperCaseReservedWordsCheck
+create TABLE ut_suite (
+ id INTEGER, -- comment
+ -- plsql:CharVarchar
+ name char(1)
+);
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 8c0d36f4d52..50a43e322ec 100644
--- a/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/plugins/PluginsTest.java
@@ -24,7 +24,10 @@ 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 java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
@@ -42,6 +45,8 @@ 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;
@@ -72,8 +77,8 @@ public class PluginsTest {
new JavaCheck(),
new JavascriptCheck(),
new PhpCheck(),
- // SONAR-7618 SonarPLI 1.5.0.702 not compatible with CE not loading @ServerSide
- // new PliCheck(),
+ new PliCheck(),
+ new PlsqlCheck(),
new PythonCheck(),
new RpgCheck(),
new SwiftCheck(),
@@ -84,7 +89,7 @@ public class PluginsTest {
private static Orchestrator ORCHESTRATOR;
@BeforeClass
- public static void startServer() {
+ public static void startServer() throws MalformedURLException {
OrchestratorBuilder builder = Orchestrator.builderEnv()
.setZipFile(byWildcardMavenFilename(new File("../sonar-application/target"), "sonar*.zip").getFile());
@@ -126,10 +131,10 @@ public class PluginsTest {
installPlugin(builder, "lua");
installPlugin(builder, "php");
installPlugin(builder, "pitest");
- // SONAR-7618 SonarPLI 1.5.0.702 not compatible with CE not loading @ServerSide
- // installPlugin(builder, "pli");
- // SONAR-7618 SonarPLSQL 2.9.0.901 not compatible with CE not loading @ServerSide
- // installPlugin(builder, "plsql");
+ // 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.
+ 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.
+ installPlugin(builder, new URL("https://sonarsource.bintray.com/CommercialDistribution/sonar-plsql-plugin/sonar-plsql-plugin-2.9.1.1051.jar"));
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");
@@ -202,4 +207,7 @@ public class PluginsTest {
builder.addPlugin(pluginKey);
}
+ private static void installPlugin(OrchestratorBuilder builder, URL url) {
+ builder.addPlugin(URLLocation.create(url));
+ }
}
diff --git a/tests/src/test/java/org/sonarqube/tests/plugins/checks/PlsqlCheck.java b/tests/src/test/java/org/sonarqube/tests/plugins/checks/PlsqlCheck.java
new file mode 100644
index 00000000000..7e4b9d96c36
--- /dev/null
+++ b/tests/src/test/java/org/sonarqube/tests/plugins/checks/PlsqlCheck.java
@@ -0,0 +1,34 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2017 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+package org.sonarqube.tests.plugins.checks;
+
+public class PlsqlCheck implements Check {
+
+ public static final String DIR = "src/plsql";
+
+ @Override
+ public void validate(Validation validation) {
+ validation.mustHaveNonEmptySource(DIR);
+ validation.mustHaveSize(DIR);
+ validation.mustHaveComments(DIR);
+ validation.mustHaveComplexity(DIR);
+ validation.mustHaveIssues(DIR + "/has-issues.sql");
+ }
+}