]> source.dussan.org Git - sonarqube.git/commitdiff
Fix integration test PluginWithoutBuiltinQualityProfile
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 11 Jun 2018 11:35:30 +0000 (13:35 +0200)
committerSonarTech <sonartech@sonarsource.com>
Tue, 12 Jun 2018 18:21:04 +0000 (20:21 +0200)
tests/plugins/foo-plugin-without-qprofile/build.gradle
tests/src/test/java/org/sonarqube/tests/Category5Suite.java
tests/src/test/java/org/sonarqube/tests/qualityProfile/PluginWithoutBuiltinQualityProfile.java [deleted file]
tests/src/test/java/org/sonarqube/tests/qualityProfile/PluginWithoutBuiltinQualityProfileTest.java [new file with mode: 0644]

index a1eed2ef89e24675c9b38cc88fe26fef18768980..789f3dd33d5644c674cbe0b7bc02e587d574919c 100644 (file)
@@ -3,9 +3,6 @@ sonarqube {
 }
 
 dependencies {
-  compile 'com.google.guava:guava'
-  compile 'commons-io:commons-io'
-  compile 'commons-lang:commons-lang'
   compileOnly 'com.google.code.findbugs:jsr305'
   compileOnly project(path: ':sonar-plugin-api', configuration: 'shadow')
 }
@@ -23,7 +20,4 @@ jar {
       'Plugin-License': 'GNU LGPL 3'
     )
   }
-  into('META-INF/lib') {
-    from configurations.compile
-  }
 }
index bf1b19e2517d31e829fc489458713cce671e621f..64cea9d35a392452dcf382e15741810e3398c611 100644 (file)
@@ -28,7 +28,7 @@ import org.sonarqube.tests.issue.IssueCreationDatePluginChangedTest;
 import org.sonarqube.tests.marketplace.UpdateCenterTest;
 import org.sonarqube.tests.qualityProfile.ActiveRuleEsResilienceTest;
 import org.sonarqube.tests.qualityProfile.BuiltInQualityProfilesNotificationTest;
-import org.sonarqube.tests.qualityProfile.PluginWithoutBuiltinQualityProfile;
+import org.sonarqube.tests.qualityProfile.PluginWithoutBuiltinQualityProfileTest;
 import org.sonarqube.tests.rule.RuleEsResilienceTest;
 import org.sonarqube.tests.serverSystem.BlueGreenTest;
 import org.sonarqube.tests.serverSystem.RestartTest;
@@ -65,7 +65,7 @@ import org.sonarqube.tests.user.UserEsResilienceTest;
   HttpHeadersAuthenticationTest.class,
   OnboardingTest.class,
   BuiltInQualityProfilesNotificationTest.class,
-  PluginWithoutBuiltinQualityProfile.class,
+  PluginWithoutBuiltinQualityProfileTest.class,
   ActiveRuleEsResilienceTest.class,
   AnalysisEsResilienceTest.class,
   RuleEsResilienceTest.class,
diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/PluginWithoutBuiltinQualityProfile.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/PluginWithoutBuiltinQualityProfile.java
deleted file mode 100644 (file)
index 37fc176..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * SonarQube
- * Copyright (C) 2009-2018 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.qualityProfile;
-
-import com.sonar.orchestrator.Orchestrator;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import org.apache.commons.io.FileUtils;
-import org.junit.After;
-import org.junit.Test;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.Assert.fail;
-import static util.ItUtils.newOrchestratorBuilder;
-import static util.ItUtils.pluginArtifact;
-
-public class PluginWithoutBuiltinQualityProfile {
-  private static Orchestrator orchestrator;
-
-  @Test
-  public void should_fail_if_plugin_defines_language_and_no_builtin_qprofile() throws IOException {
-    orchestrator = newOrchestratorBuilder()
-      .addPlugin(pluginArtifact("foo-plugin-without-qprofile"))
-      .build();
-
-    try {
-      orchestrator.start();
-      fail("Expected to fail to start");
-    } catch (IllegalStateException e) {
-      String logs = FileUtils.readFileToString(orchestrator.getServer().getWebLogs(), StandardCharsets.UTF_8);
-      assertThat(logs).contains("java.lang.IllegalStateException: The following languages have no built-in quality profiles: foo");
-    }
-  }
-
-  @After
-  public void after() {
-    if (orchestrator != null) {
-      orchestrator.stop();
-    }
-  }
-}
diff --git a/tests/src/test/java/org/sonarqube/tests/qualityProfile/PluginWithoutBuiltinQualityProfileTest.java b/tests/src/test/java/org/sonarqube/tests/qualityProfile/PluginWithoutBuiltinQualityProfileTest.java
new file mode 100644 (file)
index 0000000..f6ed250
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * SonarQube
+ * Copyright (C) 2009-2018 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.qualityProfile;
+
+import com.sonar.orchestrator.Orchestrator;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import org.apache.commons.io.FileUtils;
+import org.junit.After;
+import org.junit.Test;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assert.fail;
+import static util.ItUtils.newOrchestratorBuilder;
+import static util.ItUtils.pluginArtifact;
+
+public class PluginWithoutBuiltinQualityProfileTest {
+  private static Orchestrator orchestrator;
+
+  @Test
+  public void should_fail_if_plugin_defines_language_and_no_builtin_qprofile() throws IOException {
+    orchestrator = newOrchestratorBuilder(b -> b.addPlugin(pluginArtifact("foo-plugin-without-qprofile")));
+
+    try {
+      orchestrator.start();
+      fail("Expected to fail to start");
+    } catch (IllegalStateException e) {
+      String logs = FileUtils.readFileToString(orchestrator.getServer().getWebLogs(), StandardCharsets.UTF_8);
+      assertThat(logs).contains("java.lang.IllegalStateException: The following languages have no built-in quality profiles: foo");
+    }
+  }
+
+  @After
+  public void after() {
+    if (orchestrator != null) {
+      orchestrator.stop();
+    }
+  }
+}