From: Julien Lancelot Date: Mon, 27 Jul 2015 11:12:25 +0000 (+0200) Subject: Move I18n to administration category and refactor administration category X-Git-Tag: 5.2-RC1~952 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=949058f3fa1f3119ed16deb319284a2b30d58c27;p=sonarqube.git Move I18n to administration category and refactor administration category --- diff --git a/.travis.yml b/.travis.yml index 4df94489435..d10e4f8aaf5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ env: - JOB=ITS IT_CATEGORY=administration - JOB=ITS IT_CATEGORY=plugins - JOB=ITS IT_CATEGORY=qualitygate - - JOB=ITS IT_CATEGORY=ui - JOB=ITS IT_CATEGORY=updatecenter matrix: diff --git a/it/it-tests/src/test/java/administation/HttpsTest.java b/it/it-tests/src/test/java/administation/HttpsTest.java index 1f77039e869..5a5b26de405 100644 --- a/it/it-tests/src/test/java/administation/HttpsTest.java +++ b/it/it-tests/src/test/java/administation/HttpsTest.java @@ -67,7 +67,7 @@ public class HttpsTest { @Test public void fail_to_start_if_bad_keystore_credentials() throws Exception { try { - URL jksKeystore = getClass().getResource("/administration/HttpsTest/keystore.jks"); + URL jksKeystore = getClass().getResource("/server/HttpsTest/keystore.jks"); orchestrator = Orchestrator.builderEnv() .setServerProperty("sonar.web.https.port", String.valueOf(httpsPort)) .setServerProperty("sonar.web.https.keyAlias", "tests") @@ -86,7 +86,7 @@ public class HttpsTest { @Test public void enable_https_port() throws Exception { // start server - URL jksKeystore = getClass().getResource("/administration/HttpsTest/keystore.jks"); + URL jksKeystore = getClass().getResource("/server/HttpsTest/keystore.jks"); orchestrator = Orchestrator.builderEnv() .setServerProperty("sonar.web.https.port", String.valueOf(httpsPort)) .setServerProperty("sonar.web.https.keyAlias", "tests") diff --git a/it/it-tests/src/test/java/administation/ServerTest.java b/it/it-tests/src/test/java/administation/ServerTest.java index 0598dccc0b1..b3117821913 100644 --- a/it/it-tests/src/test/java/administation/ServerTest.java +++ b/it/it-tests/src/test/java/administation/ServerTest.java @@ -59,7 +59,7 @@ public class ServerTest { orchestrator.start(); Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("derby-warnings", - "/administration/ServerTest/derby-warning.html").build(); + "/server/ServerTest/derby-warning.html").build(); orchestrator.executeSelenese(selenese); } } @@ -73,13 +73,13 @@ public class ServerTest { orchestrator.start(); Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("jdbc-settings", - "/administration/ServerTest/hide-jdbc-settings.html").build(); + "/server/ServerTest/hide-jdbc-settings.html").build(); orchestrator.executeSelenese(selenese); } @Test public void test_settings() { - URL secretKeyUrl = getClass().getResource("/administration/ServerTest/sonar-secret.txt"); + URL secretKeyUrl = getClass().getResource("/server/ServerTest/sonar-secret.txt"); orchestrator = Orchestrator.builderEnv() .addPlugin(ItUtils.pluginArtifact("settings-plugin")) .addPlugin(ItUtils.pluginArtifact("license-plugin")) @@ -88,26 +88,26 @@ public class ServerTest { orchestrator.start(); Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("settings", - "/administration/ServerTest/settings/general-settings.html", + "/server/ServerTest/settings/general-settings.html", // SONAR-2869 the annotation @Properties can be used on extensions and not only on plugin entry points - "/administration/ServerTest/settings/hidden-extension-property.html", - "/administration/ServerTest/settings/global-extension-property.html", + "/server/ServerTest/settings/hidden-extension-property.html", + "/server/ServerTest/settings/global-extension-property.html", // SONAR-3344 - licenses - "/administration/ServerTest/settings/ignore-corrupted-license.html", - "/administration/ServerTest/settings/display-license.html", - "/administration/ServerTest/settings/display-untyped-license.html", + "/server/ServerTest/settings/ignore-corrupted-license.html", + "/server/ServerTest/settings/display-license.html", + "/server/ServerTest/settings/display-untyped-license.html", // SONAR-2084 - encryption - "/administration/ServerTest/settings/generate-secret-key.html", - "/administration/ServerTest/settings/encrypt-text.html", + "/server/ServerTest/settings/generate-secret-key.html", + "/server/ServerTest/settings/encrypt-text.html", // SONAR-1378 - property types - "/administration/ServerTest/settings/validate-property-type.html", + "/server/ServerTest/settings/validate-property-type.html", // SONAR-3127 - hide passwords - "/administration/ServerTest/settings/hide-passwords.html" + "/server/ServerTest/settings/hide-passwords.html" ).build(); orchestrator.executeSelenese(selenese); } @@ -129,7 +129,7 @@ public class ServerTest { orchestrator.executeBuilds(withDeprecatedKey, withNewKey); Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("property_relocation", - "/administration/ServerTest/settings/property_relocation.html" + "/server/ServerTest/settings/property_relocation.html" ).build(); orchestrator.executeSelenese(selenese); } @@ -202,7 +202,7 @@ public class ServerTest { public void check_minimal_sonar_version_at_startup() throws Exception { try { orchestrator = Orchestrator.builderEnv() - .addPlugin(FileLocation.of(new File(ServerTest.class.getResource("/administration/ServerTest/incompatible-plugin-1.0.jar").toURI()))) + .addPlugin(FileLocation.of(new File(ServerTest.class.getResource("/server/ServerTest/incompatible-plugin-1.0.jar").toURI()))) .build(); orchestrator.start(); fail(); @@ -224,7 +224,7 @@ public class ServerTest { .setProperty("sonar.projectKey", "myproject.jsp")); // Access dashboard Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("url_ending_by_jsp", - "/administration/ServerTest/url_ending_by_jsp.html").build(); + "/server/ServerTest/url_ending_by_jsp.html").build(); orchestrator.executeSelenese(selenese); } @@ -248,7 +248,7 @@ public class ServerTest { orchestrator.start(); Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("settings-default-value", - "/administration/ServerTest/settings-default-value.html").build(); + "/server/ServerTest/settings-default-value.html").build(); orchestrator.executeSelenese(selenese); } diff --git a/it/it-tests/src/test/java/administation/suite/AdministrationTestSuite.java b/it/it-tests/src/test/java/administation/suite/AdministrationTestSuite.java index e91265dd063..57f36e793cc 100644 --- a/it/it-tests/src/test/java/administation/suite/AdministrationTestSuite.java +++ b/it/it-tests/src/test/java/administation/suite/AdministrationTestSuite.java @@ -19,12 +19,20 @@ */ package administation.suite; +import administation.suite.administration.BulkDeletionTest; +import administation.suite.administration.ProjectAdministrationTest; +import administation.suite.administration.PropertySetsTest; +import administation.suite.administration.SubCategoriesTest; +import administation.suite.administration.WebServiceTest; +import administation.suite.server.ServerAdministrationTest; import com.sonar.orchestrator.Orchestrator; import org.junit.ClassRule; import org.junit.runner.RunWith; import org.junit.runners.Suite; import util.ItUtils; +import static util.ItUtils.pluginArtifact; + @RunWith(Suite.class) @Suite.SuiteClasses({ BulkDeletionTest.class, @@ -41,6 +49,10 @@ public class AdministrationTestSuite { .setServerProperty("sonar.notifications.delay", "1") .addPlugin(ItUtils.pluginArtifact("property-sets-plugin")) .addPlugin(ItUtils.pluginArtifact("sonar-subcategories-plugin")) + + // Used in I18nTest + .addPlugin(pluginArtifact("l10n-fr-pack")) + .addPlugin(ItUtils.xooPlugin()) .build(); } diff --git a/it/it-tests/src/test/java/administation/suite/BulkDeletionTest.java b/it/it-tests/src/test/java/administation/suite/BulkDeletionTest.java deleted file mode 100644 index 567b07da529..00000000000 --- a/it/it-tests/src/test/java/administation/suite/BulkDeletionTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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 administation.suite; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarRunner; -import com.sonar.orchestrator.selenium.Selenese; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; - -import static util.ItUtils.projectDir; - -public class BulkDeletionTest { - - @ClassRule - public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; - - @Before - public void deleteData() { - orchestrator.resetData(); - } - - /** - * SONAR-2614, SONAR-3805 - */ - @Test - public void test_bulk_deletion_on_selected_projects() throws Exception { - // we must have several projects to test the bulk deletion - executeBuild("cameleon-1", "Sample-Project"); - executeBuild("cameleon-2", "Foo-Application"); - executeBuild("cameleon-3", "Bar-Sonar-Plugin"); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project-bulk-deletion-on-selected-project", - "/administration/suite/BulkDeletionTest/project-bulk-deletion/bulk-delete-filter-projects.html" - ).build(); - orchestrator.executeSelenese(selenese); - } - - /** - * SONAR-4560 - */ - @Test - public void should_support_two_letters_long_project_name() throws Exception { - executeBuild("xo", "xo"); - - Selenese selenese = Selenese.builder() - .setHtmlTestsInClasspath("bulk-delete-projects-with-short-name", - "/administration/suite/BulkDeletionTest/project-bulk-deletion/display-two-letters-long-project.html", - "/administration/suite/BulkDeletionTest/project-bulk-deletion/filter-two-letters-long-project.html" - ).build(); - orchestrator.executeSelenese(selenese); - } - - private void executeBuild(String projectKey, String projectName) { - orchestrator.executeBuild( - SonarRunner.create(projectDir("shared/xoo-sample")) - .setProjectKey(projectKey) - .setProjectName(projectName) - ); - } - -} diff --git a/it/it-tests/src/test/java/administation/suite/ProjectAdministrationTest.java b/it/it-tests/src/test/java/administation/suite/ProjectAdministrationTest.java deleted file mode 100644 index 1370eae96d8..00000000000 --- a/it/it-tests/src/test/java/administation/suite/ProjectAdministrationTest.java +++ /dev/null @@ -1,319 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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 administation.suite; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarRunner; -import com.sonar.orchestrator.selenium.Selenese; -import java.sql.SQLException; -import java.util.Calendar; -import java.util.GregorianCalendar; -import javax.annotation.Nullable; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.sonar.wsclient.SonarClient; -import org.sonar.wsclient.base.HttpException; -import org.sonar.wsclient.permissions.PermissionParameters; -import org.sonar.wsclient.qualitygate.NewCondition; -import org.sonar.wsclient.qualitygate.QualityGate; -import org.sonar.wsclient.qualitygate.QualityGateClient; -import org.sonar.wsclient.qualitygate.QualityGateCondition; -import org.sonar.wsclient.qualitygate.UpdateCondition; -import org.sonar.wsclient.services.PropertyQuery; -import org.sonar.wsclient.services.ResourceQuery; -import org.sonar.wsclient.user.UserParameters; - -import static org.assertj.core.api.Assertions.assertThat; -import static util.ItUtils.projectDir; - -public class ProjectAdministrationTest { - - private static final String DELETE_WS_ENDPOINT = "api/projects/bulk_delete"; - @ClassRule - public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - private static final String PROJECT_KEY = "sample"; - private static final String FILE_KEY = "sample:src/main/xoo/sample/Sample.xoo"; - - @Before - public void deleteAnalysisData() throws SQLException { - orchestrator.resetData(); - } - - @Test - public void delete_project_by_web_service() { - scanSampleWithDate("2012-01-01"); - - assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNotNull(); - assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(FILE_KEY))).isNotNull(); - - orchestrator.getServer().adminWsClient().post(DELETE_WS_ENDPOINT, "keys", PROJECT_KEY); - - assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNull(); - assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(FILE_KEY))).isNull(); - } - - @Test - public void fail_when_trying_to_delete_a_file() { - expectedException.expect(HttpException.class); - scanSampleWithDate("2012-01-01"); - - assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNotNull(); - assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(FILE_KEY))).isNotNull(); - - // it's forbidden to delete only some files - orchestrator.getServer().adminWsClient().post(DELETE_WS_ENDPOINT, "keys", FILE_KEY); - } - - @Test - public void fail_when_insufficient_privilege() { - expectedException.expect(HttpException.class); - scanSampleWithDate("2012-01-01"); - - assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNotNull(); - - // use wsClient() instead of adminWsClient() - orchestrator.getServer().wsClient().post(DELETE_WS_ENDPOINT, "keys", PROJECT_KEY); - } - - /** - * Test updated for SONAR-3570 and SONAR-5923 - */ - @Test - public void project_deletion() throws Exception { - String projectAdminUser = "project-deletion-with-admin-permission-on-project"; - SonarClient adminClient = orchestrator.getServer().adminWsClient(); - try { - SonarRunner scan = SonarRunner.create(projectDir("shared/xoo-sample")); - orchestrator.executeBuild(scan); - - // Create user having admin permission on previously analysed project - adminClient.userClient().create( - UserParameters.create().login(projectAdminUser).name(projectAdminUser).password("password").passwordConfirmation("password")); - adminClient.permissionClient().addPermission( - PermissionParameters.create().user(projectAdminUser).component("sample").permission("admin")); - - orchestrator.executeSelenese( - Selenese.builder().setHtmlTestsInClasspath("project-deletion", "/administration/suite/ProjectAdministrationTest/project-deletion/project-deletion.html").build() - ); - } finally { - adminClient.userClient().deactivate(projectAdminUser); - } - } - - // SONAR-4203 - @Test - public void delete_version_of_multimodule_project() throws Exception { - GregorianCalendar today = new GregorianCalendar(); - SonarRunner build = SonarRunner.create(projectDir("shared/xoo-multi-modules-sample")) - .setProperty("sonar.dynamicAnalysis", "false") - .setProperty("sonar.projectDate", (today.get(Calendar.YEAR) - 1) + "-01-01"); - orchestrator.executeBuild(build); - - // The analysis must be run once again to have an history so that it is possible - // to set/delete version on old snapshot - build.setProperty("sonar.projectDate", today.get(Calendar.YEAR) + "-01-01"); - orchestrator.executeBuild(build); - - // There are 7 modules - assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(7); - - Selenese selenese = Selenese - .builder() - .setHtmlTestsInClasspath("delete_version_of_multimodule_project", - "/administration/suite/ProjectAdministrationTest/project-administration/multimodule-project-modify-version.html" - ).build(); - orchestrator.executeSelenese(selenese); - - assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(14); - - selenese = Selenese - .builder() - .setHtmlTestsInClasspath("delete_version_of_multimodule_project", - "/administration/suite/ProjectAdministrationTest/project-administration/multimodule-project-delete-version.html" - ).build(); - orchestrator.executeSelenese(selenese); - - assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(7); - } - - // SONAR-3326 - @Test - public void display_alerts_correctly_in_history_page() throws Exception { - QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient(); - QualityGate qGate = qgClient.create("AlertsForHistory"); - qgClient.setDefault(qGate.id()); - - // with this configuration, project should have an Orange alert - QualityGateCondition lowThresholds = qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("GT").warningThreshold("5").errorThreshold("50")); - scanSampleWithDate("2012-01-01"); - // with this configuration, project should have a Green alert - qgClient.updateCondition(UpdateCondition.create(lowThresholds.id()).metricKey("lines").operator("GT").warningThreshold("5000").errorThreshold("5000")); - scanSampleWithDate("2012-01-02"); - - Selenese selenese = Selenese - .builder() - .setHtmlTestsInClasspath("display-alerts-history-page", - "/administration/suite/ProjectAdministrationTest/display-alerts-history-page/should-display-alerts-correctly-history-page.html" - ).build(); - orchestrator.executeSelenese(selenese); - - qgClient.unsetDefault(); - qgClient.destroy(qGate.id()); - } - - /** - * SONAR-1352 - */ - @Test - public void display_period_alert_on_project_dashboard() throws Exception { - QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient(); - QualityGate qGate = qgClient.create("AlertsForDashboard"); - qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("LT").warningThreshold("0").errorThreshold("10") - .period(1)); - qgClient.setDefault(qGate.id()); - - // No alert - scanSampleWithDate("2012-01-01"); - - // Red alert because lines number has not changed since previous analysis - scanSample(); - - Selenese selenese = Selenese - .builder() - .setHtmlTestsInClasspath("display-period-alerts", - "/administration/suite/ProjectAdministrationTest/display-alerts/should-display-period-alerts-correctly.html" - ).build(); - orchestrator.executeSelenese(selenese); - - qgClient.unsetDefault(); - qgClient.destroy(qGate.id()); - } - - /** - * SONAR-3425 - */ - @Test - public void project_settings() { - scanSampleWithDate("2012-01-01"); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project-settings", - // SONAR-3425 - "/administration/suite/ProjectAdministrationTest/project-settings/override-global-settings.html", - - "/administration/suite/ProjectAdministrationTest/project-settings/only-on-project-settings.html" - ).build(); - orchestrator.executeSelenese(selenese); - - assertThat(orchestrator.getServer().getAdminWsClient().find(PropertyQuery.createForResource("sonar.skippedModules", "sample")).getValue()) - .isEqualTo("my-excluded-module"); - } - - /** - * SONAR-1608 - */ - @Test - public void bulk_update_project_keys() { - SonarRunner build = SonarRunner.create(projectDir("shared/xoo-multi-modules-sample")); - orchestrator.executeBuild(build); - - Selenese selenese = Selenese - .builder() - .setHtmlTestsInClasspath("project-bulk-update-keys", - "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html", - "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-input.html", - "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html", - "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-success.html" - ).build(); - orchestrator.executeSelenese(selenese); - } - - /** - * SONAR-1608 - */ - @Test - public void fine_grain_update_project_keys() { - SonarRunner build = SonarRunner.create(projectDir("shared/xoo-multi-modules-sample")); - orchestrator.executeBuild(build); - - Selenese selenese = Selenese - .builder() - .setHtmlTestsInClasspath("project-fine-grained-update-keys", - "/administration/suite/ProjectAdministrationTest/project-update-keys/fine-grained-update-impossible.html", - "/administration/suite/ProjectAdministrationTest/project-update-keys/fine-grained-update-success.html" - ).build(); - orchestrator.executeSelenese(selenese); - } - - @Test - public void anonymous_should_have_user_role_to_access_project() { - scanSample(); - - Selenese selenese = Selenese.builder() - .setHtmlTestsInClasspath("anonymous_should_have_user_role_to_access_project", - "/administration/suite/ProjectAdministrationTest/anonymous_should_have_user_role_to_access_project/remove_user_role.html" - ).build(); - orchestrator.executeSelenese(selenese); - } - - /** - * SONAR-4060 - */ - @Test - public void display_module_settings() { - orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-multi-modules-sample"))); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("module-settings", - // SONAR-3425 - "/administration/suite/ProjectAdministrationTest/module-settings/display-module-settings.html" - ).build(); - orchestrator.executeSelenese(selenese); - } - - private void scanSample() { - scanSample(null, null); - } - - private void scanSampleWithDate(String date) { - scanSample(date, null); - } - - private void scanSample(@Nullable String date, @Nullable String profile) { - SonarRunner scan = SonarRunner.create(projectDir("shared/xoo-sample")) - .setProperties("sonar.cpd.skip", "true"); - if (date != null) { - scan.setProperty("sonar.projectDate", date); - } - if (profile != null) { - scan.setProfile(profile); - } - orchestrator.executeBuild(scan); - } - - private int count(String condition) { - return orchestrator.getDatabase().countSql("select count(*) from " + condition); - } - -} diff --git a/it/it-tests/src/test/java/administation/suite/PropertySetsTest.java b/it/it-tests/src/test/java/administation/suite/PropertySetsTest.java deleted file mode 100644 index 3ef89bb98e2..00000000000 --- a/it/it-tests/src/test/java/administation/suite/PropertySetsTest.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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 administation.suite; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.selenium.Selenese; -import org.junit.ClassRule; -import org.junit.Test; -import org.sonar.wsclient.services.PropertyQuery; -import org.sonar.wsclient.services.PropertyUpdateQuery; - -import static org.assertj.core.api.Assertions.assertThat; - -public class PropertySetsTest { - - @ClassRule - public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; - - @Test - public void should_support_property_sets() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("property-sets", - "/administration/suite/PropertySetsTest/property-sets/create.html", - "/administration/suite/PropertySetsTest/property-sets/delete.html", - "/administration/suite/PropertySetsTest/property-sets/reference.html", - "/administration/suite/PropertySetsTest/property-sets/all_types.html" - ).build(); - orchestrator.executeSelenese(selenese); - - // SSF-25 Check that the password has well be setted as now it does not appears in the html source code - String sonarDemoValue = getProperty("sonar.demo"); - assertThat(getProperty("sonar.demo." + sonarDemoValue + ".password")).isEqualTo("abcde"); - } - - @Test - public void should_edit_properties() { - setProperty("sonar.test.jira.servers", "jira1,jira2"); - setProperty("sonar.test.jira.servers.jira1.url", "http://jira1"); - setProperty("sonar.test.jira.servers.jira2.url", "http://jira2"); - setProperty("sonar.test.jira.servers.jira1.port", "12345"); - setProperty("sonar.test.jira.servers.jira2.port", "66666"); - - assertThat(getProperty("sonar.test.jira.servers")).isEqualTo("jira1,jira2"); - assertThat(getProperty("sonar.test.jira.servers.jira1.url")).isEqualTo("http://jira1"); - assertThat(getProperty("sonar.test.jira.servers.jira2.url")).isEqualTo("http://jira2"); - assertThat(getProperty("sonar.test.jira.servers.jira1.port")).isEqualTo("12345"); - assertThat(getProperty("sonar.test.jira.servers.jira2.port")).isEqualTo("66666"); - } - - @Test - public void should_support_property_sets_with_auto_generated_keys() { - orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("create-auto-generated", - "/administration/suite/PropertySetsTest/auto-generated/create.html" - ).build()); - - String[] keys = getProperty("sonar.autogenerated").split("[,]"); - assertThat(getProperty("sonar.autogenerated." + keys[0] + ".value")).isEqualTo("FIRST"); - assertThat(getProperty("sonar.autogenerated." + keys[1] + ".value")).isEqualTo("SECOND"); - assertThat(getProperty("sonar.autogenerated." + keys[2] + ".value")).isEqualTo("THIRD"); - - orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("update-auto-generated", - "/administration/suite/PropertySetsTest/auto-generated/update.html" - ).build()); - - keys = getProperty("sonar.autogenerated").split("[,]"); - assertThat(getProperty("sonar.autogenerated." + keys[0] + ".value")).isEqualTo("FIRST"); - assertThat(getProperty("sonar.autogenerated." + keys[1] + ".value")).isEqualTo("THIRD"); - } - - static void setProperty(String key, String value) { - orchestrator.getServer().getAdminWsClient().update(new PropertyUpdateQuery(key, value)); - } - - static String getProperty(String key) { - return orchestrator.getServer().getAdminWsClient().find(new PropertyQuery().setKey(key)).getValue(); - } -} diff --git a/it/it-tests/src/test/java/administation/suite/ServerAdministrationTest.java b/it/it-tests/src/test/java/administation/suite/ServerAdministrationTest.java deleted file mode 100644 index 20e15bec86a..00000000000 --- a/it/it-tests/src/test/java/administation/suite/ServerAdministrationTest.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (C) 2009-2014 SonarSource SA - * All rights reserved - * mailto:contact AT sonarsource DOT com - */ -package administation.suite; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.selenium.Selenese; -import java.io.IOException; -import java.util.List; -import java.util.Map; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.json.simple.JSONValue; -import org.junit.ClassRule; -import org.junit.Test; -import org.sonar.wsclient.services.Server; -import org.sonar.wsclient.services.ServerQuery; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.Assert.fail; - -public class ServerAdministrationTest { - - @ClassRule - public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; - - @Test - public void get_sonar_version() { - String version = orchestrator.getServer().getWsClient().find(new ServerQuery()).getVersion(); - if (!StringUtils.startsWithAny(version, new String[] {"5.", "6."})) { - fail("Bad version: " + version); - } - } - - @Test - public void get_server_status() { - assertThat(orchestrator.getServer().getWsClient().find(new ServerQuery()).getStatus()).isEqualTo(Server.Status.UP); - } - - @Test - public void generate_server_id() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("server_id", - "/administration/suite/ServerAdministrationTest/server_id/missing_ip.html", - // SONAR-4102 - "/administration/suite/ServerAdministrationTest/organisation_must_not_accept_special_chars.html", - "/administration/suite/ServerAdministrationTest/valid_id.html").build(); - orchestrator.executeSelenese(selenese); - } - - @Test - public void display_system_info() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("server-administration", - "/administration/suite/ServerAdministrationTest/server-administration/system_info.html" - ).build(); - orchestrator.executeSelenese(selenese); - } - - /** - * SONAR-3147 - */ - @Test - public void test_widgets_web_service() throws IOException { - HttpClient httpclient = new DefaultHttpClient(); - try { - HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/api/widgets"); - HttpResponse response = httpclient.execute(get); - - assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); - String json = IOUtils.toString(response.getEntity().getContent()); - List widgets = (List) JSONValue.parse(json); - assertThat(widgets.size()).isGreaterThan(10); - - // quick test of the first widget - assertThat(((Map) widgets.get(0)).get("title")).isNotNull(); - - EntityUtils.consume(response.getEntity()); - - } finally { - httpclient.getConnectionManager().shutdown(); - } - } - - /** - * SONAR-5197 - */ - @Test - public void api_ws_shortcut() throws Exception { - HttpClient httpclient = new DefaultHttpClient(); - try { - HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/api"); - HttpResponse response = httpclient.execute(get); - - assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); - String json = IOUtils.toString(response.getEntity().getContent()); - Map jsonAsMap = (Map) JSONValue.parse(json); - assertThat(jsonAsMap.get("webServices")).isNotNull(); - EntityUtils.consume(response.getEntity()); - - } finally { - httpclient.getConnectionManager().shutdown(); - } - } -} diff --git a/it/it-tests/src/test/java/administation/suite/SubCategoriesTest.java b/it/it-tests/src/test/java/administation/suite/SubCategoriesTest.java deleted file mode 100644 index 95413851c43..00000000000 --- a/it/it-tests/src/test/java/administation/suite/SubCategoriesTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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 administation.suite; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarRunner; -import com.sonar.orchestrator.selenium.Selenese; -import org.junit.ClassRule; -import org.junit.Test; -import org.sonar.wsclient.services.PropertyQuery; - -import static org.assertj.core.api.Assertions.assertThat; -import static util.ItUtils.projectDir; - -public class SubCategoriesTest { - - @ClassRule - public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; - - /** - * SONAR-3159 - */ - @Test - public void should_support_global_subcategories() { - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("subcategories", - "/administration/suite/SubCategoriesTest/subcategories/global-subcategories.html", - // SONAR-4495 - "/administration/suite/SubCategoriesTest/subcategories/global-subcategories-no-default.html" - ).build(); - orchestrator.executeSelenese(selenese); - assertThat(getProperty("prop3", null)).isEqualTo("myValue"); - } - - /** - * SONAR-3159 - */ - @Test - public void should_support_project_subcategories() { - orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("subcategories", - "/administration/suite/SubCategoriesTest/subcategories/project-subcategories.html", - // SONAR-4495 - "/administration/suite/SubCategoriesTest/subcategories/project-subcategories-no-default.html" - ).build(); - orchestrator.executeSelenese(selenese); - assertThat(getProperty("prop3", "sample")).isEqualTo("myValue2"); - } - - static String getProperty(String key, String resourceKeyOrId) { - return orchestrator.getServer().getAdminWsClient().find(new PropertyQuery().setKey(key).setResourceKeyOrId(resourceKeyOrId)).getValue(); - } -} diff --git a/it/it-tests/src/test/java/administation/suite/WebServiceTest.java b/it/it-tests/src/test/java/administation/suite/WebServiceTest.java deleted file mode 100644 index 85c4394fb7e..00000000000 --- a/it/it-tests/src/test/java/administation/suite/WebServiceTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2009-2014 SonarSource SA - * All rights reserved - * mailto:contact AT sonarsource DOT com - */ -package administation.suite; - -import com.google.common.base.Function; -import com.google.common.collect.Iterables; -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarRunner; -import java.io.IOException; -import java.util.List; -import org.apache.commons.io.IOUtils; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.util.EntityUtils; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Test; -import org.sonar.wsclient.Sonar; -import org.sonar.wsclient.services.Favourite; -import org.sonar.wsclient.services.FavouriteCreateQuery; -import org.sonar.wsclient.services.FavouriteDeleteQuery; -import org.sonar.wsclient.services.FavouriteQuery; - -import static com.google.common.collect.Lists.newArrayList; -import static org.assertj.core.api.Assertions.assertThat; -import static util.ItUtils.projectDir; - -public class WebServiceTest { - - @ClassRule - public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; - - @Before - public void inspectProject() { - orchestrator.resetData(); - orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); - } - - @Test - public void favourites_web_service() throws Exception { - Sonar adminWsClient = orchestrator.getServer().getAdminWsClient(); - - // GET (nothing) - List favourites = adminWsClient.findAll(new FavouriteQuery()); - assertThat(favourites).isEmpty(); - - // POST (create favourites) - Favourite favourite = adminWsClient.create(new FavouriteCreateQuery("sample")); - assertThat(favourite).isNotNull(); - assertThat(favourite.getKey()).isEqualTo("sample"); - adminWsClient.create(new FavouriteCreateQuery("sample:src/main/xoo/sample/Sample.xoo")); - - // GET (created favourites) - favourites = adminWsClient.findAll(new FavouriteQuery()); - assertThat(favourites).hasSize(2); - List keys = newArrayList(Iterables.transform(favourites, new Function() { - @Override - public String apply(Favourite input) { - return input.getKey(); - } - })); - assertThat(keys).containsOnly("sample", "sample:src/main/xoo/sample/Sample.xoo"); - - // DELETE (a favourite) - adminWsClient.delete(new FavouriteDeleteQuery("sample")); - favourites = adminWsClient.findAll(new FavouriteQuery()); - assertThat(favourites).hasSize(1); - assertThat(favourites.get(0).getKey()).isEqualTo("sample:src/main/xoo/sample/Sample.xoo"); - } - - /** - * SONAR-3105 - */ - @Test - public void projects_web_service() throws IOException { - SonarRunner build = SonarRunner.create(projectDir("shared/xoo-sample")); - orchestrator.executeBuild(build); - - String url = orchestrator.getServer().getUrl() + "/api/projects?key=sample&versions=true"; - HttpClient httpclient = new DefaultHttpClient(); - try { - HttpGet get = new HttpGet(url); - HttpResponse response = httpclient.execute(get); - - assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); - String content = IOUtils.toString(response.getEntity().getContent()); - assertThat(content).doesNotContain("error"); - assertThat(content).contains("sample"); - EntityUtils.consume(response.getEntity()); - - } finally { - httpclient.getConnectionManager().shutdown(); - } - } - -} diff --git a/it/it-tests/src/test/java/administation/suite/administration/BulkDeletionTest.java b/it/it-tests/src/test/java/administation/suite/administration/BulkDeletionTest.java new file mode 100644 index 00000000000..963a23b6eec --- /dev/null +++ b/it/it-tests/src/test/java/administation/suite/administration/BulkDeletionTest.java @@ -0,0 +1,81 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube 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. + * + * SonarQube 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 administation.suite.administration; + +import administation.suite.AdministrationTestSuite; +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; + +import static util.ItUtils.projectDir; + +public class BulkDeletionTest { + + @ClassRule + public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; + + @Before + public void deleteData() { + orchestrator.resetData(); + } + + /** + * SONAR-2614, SONAR-3805 + */ + @Test + public void test_bulk_deletion_on_selected_projects() throws Exception { + // we must have several projects to test the bulk deletion + executeBuild("cameleon-1", "Sample-Project"); + executeBuild("cameleon-2", "Foo-Application"); + executeBuild("cameleon-3", "Bar-Sonar-Plugin"); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project-bulk-deletion-on-selected-project", + "/administration/suite/BulkDeletionTest/project-bulk-deletion/bulk-delete-filter-projects.html" + ).build(); + orchestrator.executeSelenese(selenese); + } + + /** + * SONAR-4560 + */ + @Test + public void should_support_two_letters_long_project_name() throws Exception { + executeBuild("xo", "xo"); + + Selenese selenese = Selenese.builder() + .setHtmlTestsInClasspath("bulk-delete-projects-with-short-name", + "/administration/suite/BulkDeletionTest/project-bulk-deletion/display-two-letters-long-project.html", + "/administration/suite/BulkDeletionTest/project-bulk-deletion/filter-two-letters-long-project.html" + ).build(); + orchestrator.executeSelenese(selenese); + } + + private void executeBuild(String projectKey, String projectName) { + orchestrator.executeBuild( + SonarRunner.create(projectDir("shared/xoo-sample")) + .setProjectKey(projectKey) + .setProjectName(projectName) + ); + } + +} diff --git a/it/it-tests/src/test/java/administation/suite/administration/ProjectAdministrationTest.java b/it/it-tests/src/test/java/administation/suite/administration/ProjectAdministrationTest.java new file mode 100644 index 00000000000..cc405f0b49e --- /dev/null +++ b/it/it-tests/src/test/java/administation/suite/administration/ProjectAdministrationTest.java @@ -0,0 +1,320 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube 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. + * + * SonarQube 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 administation.suite.administration; + +import administation.suite.AdministrationTestSuite; +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import java.sql.SQLException; +import java.util.Calendar; +import java.util.GregorianCalendar; +import javax.annotation.Nullable; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.sonar.wsclient.SonarClient; +import org.sonar.wsclient.base.HttpException; +import org.sonar.wsclient.permissions.PermissionParameters; +import org.sonar.wsclient.qualitygate.NewCondition; +import org.sonar.wsclient.qualitygate.QualityGate; +import org.sonar.wsclient.qualitygate.QualityGateClient; +import org.sonar.wsclient.qualitygate.QualityGateCondition; +import org.sonar.wsclient.qualitygate.UpdateCondition; +import org.sonar.wsclient.services.PropertyQuery; +import org.sonar.wsclient.services.ResourceQuery; +import org.sonar.wsclient.user.UserParameters; + +import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.projectDir; + +public class ProjectAdministrationTest { + + private static final String DELETE_WS_ENDPOINT = "api/projects/bulk_delete"; + @ClassRule + public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + private static final String PROJECT_KEY = "sample"; + private static final String FILE_KEY = "sample:src/main/xoo/sample/Sample.xoo"; + + @Before + public void deleteAnalysisData() throws SQLException { + orchestrator.resetData(); + } + + @Test + public void delete_project_by_web_service() { + scanSampleWithDate("2012-01-01"); + + assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNotNull(); + assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(FILE_KEY))).isNotNull(); + + orchestrator.getServer().adminWsClient().post(DELETE_WS_ENDPOINT, "keys", PROJECT_KEY); + + assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNull(); + assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(FILE_KEY))).isNull(); + } + + @Test + public void fail_when_trying_to_delete_a_file() { + expectedException.expect(HttpException.class); + scanSampleWithDate("2012-01-01"); + + assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNotNull(); + assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(FILE_KEY))).isNotNull(); + + // it's forbidden to delete only some files + orchestrator.getServer().adminWsClient().post(DELETE_WS_ENDPOINT, "keys", FILE_KEY); + } + + @Test + public void fail_when_insufficient_privilege() { + expectedException.expect(HttpException.class); + scanSampleWithDate("2012-01-01"); + + assertThat(orchestrator.getServer().getWsClient().find(ResourceQuery.create(PROJECT_KEY))).isNotNull(); + + // use wsClient() instead of adminWsClient() + orchestrator.getServer().wsClient().post(DELETE_WS_ENDPOINT, "keys", PROJECT_KEY); + } + + /** + * Test updated for SONAR-3570 and SONAR-5923 + */ + @Test + public void project_deletion() throws Exception { + String projectAdminUser = "project-deletion-with-admin-permission-on-project"; + SonarClient adminClient = orchestrator.getServer().adminWsClient(); + try { + SonarRunner scan = SonarRunner.create(projectDir("shared/xoo-sample")); + orchestrator.executeBuild(scan); + + // Create user having admin permission on previously analysed project + adminClient.userClient().create( + UserParameters.create().login(projectAdminUser).name(projectAdminUser).password("password").passwordConfirmation("password")); + adminClient.permissionClient().addPermission( + PermissionParameters.create().user(projectAdminUser).component("sample").permission("admin")); + + orchestrator.executeSelenese( + Selenese.builder().setHtmlTestsInClasspath("project-deletion", "/administration/suite/ProjectAdministrationTest/project-deletion/project-deletion.html").build() + ); + } finally { + adminClient.userClient().deactivate(projectAdminUser); + } + } + + // SONAR-4203 + @Test + public void delete_version_of_multimodule_project() throws Exception { + GregorianCalendar today = new GregorianCalendar(); + SonarRunner build = SonarRunner.create(projectDir("shared/xoo-multi-modules-sample")) + .setProperty("sonar.dynamicAnalysis", "false") + .setProperty("sonar.projectDate", (today.get(Calendar.YEAR) - 1) + "-01-01"); + orchestrator.executeBuild(build); + + // The analysis must be run once again to have an history so that it is possible + // to set/delete version on old snapshot + build.setProperty("sonar.projectDate", today.get(Calendar.YEAR) + "-01-01"); + orchestrator.executeBuild(build); + + // There are 7 modules + assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(7); + + Selenese selenese = Selenese + .builder() + .setHtmlTestsInClasspath("delete_version_of_multimodule_project", + "/administration/suite/ProjectAdministrationTest/project-administration/multimodule-project-modify-version.html" + ).build(); + orchestrator.executeSelenese(selenese); + + assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(14); + + selenese = Selenese + .builder() + .setHtmlTestsInClasspath("delete_version_of_multimodule_project", + "/administration/suite/ProjectAdministrationTest/project-administration/multimodule-project-delete-version.html" + ).build(); + orchestrator.executeSelenese(selenese); + + assertThat(count("events where category='Version'")).as("Different number of events").isEqualTo(7); + } + + // SONAR-3326 + @Test + public void display_alerts_correctly_in_history_page() throws Exception { + QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient(); + QualityGate qGate = qgClient.create("AlertsForHistory"); + qgClient.setDefault(qGate.id()); + + // with this configuration, project should have an Orange alert + QualityGateCondition lowThresholds = qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("GT").warningThreshold("5").errorThreshold("50")); + scanSampleWithDate("2012-01-01"); + // with this configuration, project should have a Green alert + qgClient.updateCondition(UpdateCondition.create(lowThresholds.id()).metricKey("lines").operator("GT").warningThreshold("5000").errorThreshold("5000")); + scanSampleWithDate("2012-01-02"); + + Selenese selenese = Selenese + .builder() + .setHtmlTestsInClasspath("display-alerts-history-page", + "/administration/suite/ProjectAdministrationTest/display-alerts-history-page/should-display-alerts-correctly-history-page.html" + ).build(); + orchestrator.executeSelenese(selenese); + + qgClient.unsetDefault(); + qgClient.destroy(qGate.id()); + } + + /** + * SONAR-1352 + */ + @Test + public void display_period_alert_on_project_dashboard() throws Exception { + QualityGateClient qgClient = orchestrator.getServer().adminWsClient().qualityGateClient(); + QualityGate qGate = qgClient.create("AlertsForDashboard"); + qgClient.createCondition(NewCondition.create(qGate.id()).metricKey("lines").operator("LT").warningThreshold("0").errorThreshold("10") + .period(1)); + qgClient.setDefault(qGate.id()); + + // No alert + scanSampleWithDate("2012-01-01"); + + // Red alert because lines number has not changed since previous analysis + scanSample(); + + Selenese selenese = Selenese + .builder() + .setHtmlTestsInClasspath("display-period-alerts", + "/administration/suite/ProjectAdministrationTest/display-alerts/should-display-period-alerts-correctly.html" + ).build(); + orchestrator.executeSelenese(selenese); + + qgClient.unsetDefault(); + qgClient.destroy(qGate.id()); + } + + /** + * SONAR-3425 + */ + @Test + public void project_settings() { + scanSampleWithDate("2012-01-01"); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("project-settings", + // SONAR-3425 + "/administration/suite/ProjectAdministrationTest/project-settings/override-global-settings.html", + + "/administration/suite/ProjectAdministrationTest/project-settings/only-on-project-settings.html" + ).build(); + orchestrator.executeSelenese(selenese); + + assertThat(orchestrator.getServer().getAdminWsClient().find(PropertyQuery.createForResource("sonar.skippedModules", "sample")).getValue()) + .isEqualTo("my-excluded-module"); + } + + /** + * SONAR-1608 + */ + @Test + public void bulk_update_project_keys() { + SonarRunner build = SonarRunner.create(projectDir("shared/xoo-multi-modules-sample")); + orchestrator.executeBuild(build); + + Selenese selenese = Selenese + .builder() + .setHtmlTestsInClasspath("project-bulk-update-keys", + "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-duplicate-keys.html", + "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-input.html", + "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-impossible-because-no-match.html", + "/administration/suite/ProjectAdministrationTest/project-update-keys/bulk-update-success.html" + ).build(); + orchestrator.executeSelenese(selenese); + } + + /** + * SONAR-1608 + */ + @Test + public void fine_grain_update_project_keys() { + SonarRunner build = SonarRunner.create(projectDir("shared/xoo-multi-modules-sample")); + orchestrator.executeBuild(build); + + Selenese selenese = Selenese + .builder() + .setHtmlTestsInClasspath("project-fine-grained-update-keys", + "/administration/suite/ProjectAdministrationTest/project-update-keys/fine-grained-update-impossible.html", + "/administration/suite/ProjectAdministrationTest/project-update-keys/fine-grained-update-success.html" + ).build(); + orchestrator.executeSelenese(selenese); + } + + @Test + public void anonymous_should_have_user_role_to_access_project() { + scanSample(); + + Selenese selenese = Selenese.builder() + .setHtmlTestsInClasspath("anonymous_should_have_user_role_to_access_project", + "/administration/suite/ProjectAdministrationTest/anonymous_should_have_user_role_to_access_project/remove_user_role.html" + ).build(); + orchestrator.executeSelenese(selenese); + } + + /** + * SONAR-4060 + */ + @Test + public void display_module_settings() { + orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-multi-modules-sample"))); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("module-settings", + // SONAR-3425 + "/administration/suite/ProjectAdministrationTest/module-settings/display-module-settings.html" + ).build(); + orchestrator.executeSelenese(selenese); + } + + private void scanSample() { + scanSample(null, null); + } + + private void scanSampleWithDate(String date) { + scanSample(date, null); + } + + private void scanSample(@Nullable String date, @Nullable String profile) { + SonarRunner scan = SonarRunner.create(projectDir("shared/xoo-sample")) + .setProperties("sonar.cpd.skip", "true"); + if (date != null) { + scan.setProperty("sonar.projectDate", date); + } + if (profile != null) { + scan.setProfile(profile); + } + orchestrator.executeBuild(scan); + } + + private int count(String condition) { + return orchestrator.getDatabase().countSql("select count(*) from " + condition); + } + +} diff --git a/it/it-tests/src/test/java/administation/suite/administration/PropertySetsTest.java b/it/it-tests/src/test/java/administation/suite/administration/PropertySetsTest.java new file mode 100644 index 00000000000..007eac65477 --- /dev/null +++ b/it/it-tests/src/test/java/administation/suite/administration/PropertySetsTest.java @@ -0,0 +1,94 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube 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. + * + * SonarQube 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 administation.suite.administration; + +import administation.suite.AdministrationTestSuite; +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.selenium.Selenese; +import org.junit.ClassRule; +import org.junit.Test; +import org.sonar.wsclient.services.PropertyQuery; +import org.sonar.wsclient.services.PropertyUpdateQuery; + +import static org.assertj.core.api.Assertions.assertThat; + +public class PropertySetsTest { + + @ClassRule + public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; + + @Test + public void should_support_property_sets() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("property-sets", + "/administration/suite/PropertySetsTest/property-sets/create.html", + "/administration/suite/PropertySetsTest/property-sets/delete.html", + "/administration/suite/PropertySetsTest/property-sets/reference.html", + "/administration/suite/PropertySetsTest/property-sets/all_types.html" + ).build(); + orchestrator.executeSelenese(selenese); + + // SSF-25 Check that the password has well be setted as now it does not appears in the html source code + String sonarDemoValue = getProperty("sonar.demo"); + assertThat(getProperty("sonar.demo." + sonarDemoValue + ".password")).isEqualTo("abcde"); + } + + @Test + public void should_edit_properties() { + setProperty("sonar.test.jira.servers", "jira1,jira2"); + setProperty("sonar.test.jira.servers.jira1.url", "http://jira1"); + setProperty("sonar.test.jira.servers.jira2.url", "http://jira2"); + setProperty("sonar.test.jira.servers.jira1.port", "12345"); + setProperty("sonar.test.jira.servers.jira2.port", "66666"); + + assertThat(getProperty("sonar.test.jira.servers")).isEqualTo("jira1,jira2"); + assertThat(getProperty("sonar.test.jira.servers.jira1.url")).isEqualTo("http://jira1"); + assertThat(getProperty("sonar.test.jira.servers.jira2.url")).isEqualTo("http://jira2"); + assertThat(getProperty("sonar.test.jira.servers.jira1.port")).isEqualTo("12345"); + assertThat(getProperty("sonar.test.jira.servers.jira2.port")).isEqualTo("66666"); + } + + @Test + public void should_support_property_sets_with_auto_generated_keys() { + orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("create-auto-generated", + "/administration/suite/PropertySetsTest/auto-generated/create.html" + ).build()); + + String[] keys = getProperty("sonar.autogenerated").split("[,]"); + assertThat(getProperty("sonar.autogenerated." + keys[0] + ".value")).isEqualTo("FIRST"); + assertThat(getProperty("sonar.autogenerated." + keys[1] + ".value")).isEqualTo("SECOND"); + assertThat(getProperty("sonar.autogenerated." + keys[2] + ".value")).isEqualTo("THIRD"); + + orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("update-auto-generated", + "/administration/suite/PropertySetsTest/auto-generated/update.html" + ).build()); + + keys = getProperty("sonar.autogenerated").split("[,]"); + assertThat(getProperty("sonar.autogenerated." + keys[0] + ".value")).isEqualTo("FIRST"); + assertThat(getProperty("sonar.autogenerated." + keys[1] + ".value")).isEqualTo("THIRD"); + } + + static void setProperty(String key, String value) { + orchestrator.getServer().getAdminWsClient().update(new PropertyUpdateQuery(key, value)); + } + + static String getProperty(String key) { + return orchestrator.getServer().getAdminWsClient().find(new PropertyQuery().setKey(key)).getValue(); + } +} diff --git a/it/it-tests/src/test/java/administation/suite/administration/SubCategoriesTest.java b/it/it-tests/src/test/java/administation/suite/administration/SubCategoriesTest.java new file mode 100644 index 00000000000..fc4b86928b7 --- /dev/null +++ b/it/it-tests/src/test/java/administation/suite/administration/SubCategoriesTest.java @@ -0,0 +1,71 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube 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. + * + * SonarQube 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 administation.suite.administration; + +import administation.suite.AdministrationTestSuite; +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import org.junit.ClassRule; +import org.junit.Test; +import org.sonar.wsclient.services.PropertyQuery; + +import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.projectDir; + +public class SubCategoriesTest { + + @ClassRule + public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; + + /** + * SONAR-3159 + */ + @Test + public void should_support_global_subcategories() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("subcategories", + "/administration/suite/SubCategoriesTest/subcategories/global-subcategories.html", + // SONAR-4495 + "/administration/suite/SubCategoriesTest/subcategories/global-subcategories-no-default.html" + ).build(); + orchestrator.executeSelenese(selenese); + assertThat(getProperty("prop3", null)).isEqualTo("myValue"); + } + + /** + * SONAR-3159 + */ + @Test + public void should_support_project_subcategories() { + orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("subcategories", + "/administration/suite/SubCategoriesTest/subcategories/project-subcategories.html", + // SONAR-4495 + "/administration/suite/SubCategoriesTest/subcategories/project-subcategories-no-default.html" + ).build(); + orchestrator.executeSelenese(selenese); + assertThat(getProperty("prop3", "sample")).isEqualTo("myValue2"); + } + + static String getProperty(String key, String resourceKeyOrId) { + return orchestrator.getServer().getAdminWsClient().find(new PropertyQuery().setKey(key).setResourceKeyOrId(resourceKeyOrId)).getValue(); + } +} diff --git a/it/it-tests/src/test/java/administation/suite/administration/WebServiceTest.java b/it/it-tests/src/test/java/administation/suite/administration/WebServiceTest.java new file mode 100644 index 00000000000..d0d2b01aff1 --- /dev/null +++ b/it/it-tests/src/test/java/administation/suite/administration/WebServiceTest.java @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2009-2014 SonarSource SA + * All rights reserved + * mailto:contact AT sonarsource DOT com + */ +package administation.suite.administration; + +import administation.suite.AdministrationTestSuite; +import com.google.common.base.Function; +import com.google.common.collect.Iterables; +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import java.io.IOException; +import java.util.List; +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.util.EntityUtils; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Test; +import org.sonar.wsclient.Sonar; +import org.sonar.wsclient.services.Favourite; +import org.sonar.wsclient.services.FavouriteCreateQuery; +import org.sonar.wsclient.services.FavouriteDeleteQuery; +import org.sonar.wsclient.services.FavouriteQuery; + +import static com.google.common.collect.Lists.newArrayList; +import static org.assertj.core.api.Assertions.assertThat; +import static util.ItUtils.projectDir; + +public class WebServiceTest { + + @ClassRule + public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; + + @Before + public void inspectProject() { + orchestrator.resetData(); + orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); + } + + @Test + public void favourites_web_service() throws Exception { + Sonar adminWsClient = orchestrator.getServer().getAdminWsClient(); + + // GET (nothing) + List favourites = adminWsClient.findAll(new FavouriteQuery()); + assertThat(favourites).isEmpty(); + + // POST (create favourites) + Favourite favourite = adminWsClient.create(new FavouriteCreateQuery("sample")); + assertThat(favourite).isNotNull(); + assertThat(favourite.getKey()).isEqualTo("sample"); + adminWsClient.create(new FavouriteCreateQuery("sample:src/main/xoo/sample/Sample.xoo")); + + // GET (created favourites) + favourites = adminWsClient.findAll(new FavouriteQuery()); + assertThat(favourites).hasSize(2); + List keys = newArrayList(Iterables.transform(favourites, new Function() { + @Override + public String apply(Favourite input) { + return input.getKey(); + } + })); + assertThat(keys).containsOnly("sample", "sample:src/main/xoo/sample/Sample.xoo"); + + // DELETE (a favourite) + adminWsClient.delete(new FavouriteDeleteQuery("sample")); + favourites = adminWsClient.findAll(new FavouriteQuery()); + assertThat(favourites).hasSize(1); + assertThat(favourites.get(0).getKey()).isEqualTo("sample:src/main/xoo/sample/Sample.xoo"); + } + + /** + * SONAR-3105 + */ + @Test + public void projects_web_service() throws IOException { + SonarRunner build = SonarRunner.create(projectDir("shared/xoo-sample")); + orchestrator.executeBuild(build); + + String url = orchestrator.getServer().getUrl() + "/api/projects?key=sample&versions=true"; + HttpClient httpclient = new DefaultHttpClient(); + try { + HttpGet get = new HttpGet(url); + HttpResponse response = httpclient.execute(get); + + assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); + String content = IOUtils.toString(response.getEntity().getContent()); + assertThat(content).doesNotContain("error"); + assertThat(content).contains("sample"); + EntityUtils.consume(response.getEntity()); + + } finally { + httpclient.getConnectionManager().shutdown(); + } + } + +} diff --git a/it/it-tests/src/test/java/administation/suite/server/ServerAdministrationTest.java b/it/it-tests/src/test/java/administation/suite/server/ServerAdministrationTest.java new file mode 100644 index 00000000000..b023d8e2ac1 --- /dev/null +++ b/it/it-tests/src/test/java/administation/suite/server/ServerAdministrationTest.java @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2009-2014 SonarSource SA + * All rights reserved + * mailto:contact AT sonarsource DOT com + */ +package administation.suite.server; + +import administation.suite.AdministrationTestSuite; +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.selenium.Selenese; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.util.EntityUtils; +import org.json.simple.JSONValue; +import org.junit.ClassRule; +import org.junit.Test; +import org.sonar.wsclient.services.Server; +import org.sonar.wsclient.services.ServerQuery; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.fail; + +public class ServerAdministrationTest { + + @ClassRule + public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; + + @Test + public void get_sonar_version() { + String version = orchestrator.getServer().getWsClient().find(new ServerQuery()).getVersion(); + if (!StringUtils.startsWithAny(version, new String[] {"5.", "6."})) { + fail("Bad version: " + version); + } + } + + @Test + public void get_server_status() { + assertThat(orchestrator.getServer().getWsClient().find(new ServerQuery()).getStatus()).isEqualTo(Server.Status.UP); + } + + @Test + public void generate_server_id() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("server_id", + "/server/ServerAdministrationTest/server_id/missing_ip.html", + // SONAR-4102 + "/server/ServerAdministrationTest/organisation_must_not_accept_special_chars.html", + "/server/ServerAdministrationTest/valid_id.html").build(); + orchestrator.executeSelenese(selenese); + } + + @Test + public void display_system_info() { + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("server-administration", + "/server/ServerAdministrationTest/server-administration/system_info.html" + ).build(); + orchestrator.executeSelenese(selenese); + } + + /** + * SONAR-3147 + */ + @Test + public void test_widgets_web_service() throws IOException { + HttpClient httpclient = new DefaultHttpClient(); + try { + HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/api/widgets"); + HttpResponse response = httpclient.execute(get); + + assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); + String json = IOUtils.toString(response.getEntity().getContent()); + List widgets = (List) JSONValue.parse(json); + assertThat(widgets.size()).isGreaterThan(10); + + // quick test of the first widget + assertThat(((Map) widgets.get(0)).get("title")).isNotNull(); + + EntityUtils.consume(response.getEntity()); + + } finally { + httpclient.getConnectionManager().shutdown(); + } + } + + /** + * SONAR-5197 + */ + @Test + public void api_ws_shortcut() throws Exception { + HttpClient httpclient = new DefaultHttpClient(); + try { + HttpGet get = new HttpGet(orchestrator.getServer().getUrl() + "/api"); + HttpResponse response = httpclient.execute(get); + + assertThat(response.getStatusLine().getStatusCode()).isEqualTo(200); + String json = IOUtils.toString(response.getEntity().getContent()); + Map jsonAsMap = (Map) JSONValue.parse(json); + assertThat(jsonAsMap.get("webServices")).isNotNull(); + EntityUtils.consume(response.getEntity()); + + } finally { + httpclient.getConnectionManager().shutdown(); + } + } +} diff --git a/it/it-tests/src/test/java/administation/suite/ui/I18nTest.java b/it/it-tests/src/test/java/administation/suite/ui/I18nTest.java new file mode 100644 index 00000000000..1a5e3d89389 --- /dev/null +++ b/it/it-tests/src/test/java/administation/suite/ui/I18nTest.java @@ -0,0 +1,59 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube 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. + * + * SonarQube 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 administation.suite.ui; + +import administation.suite.AdministrationTestSuite; +import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.build.SonarRunner; +import com.sonar.orchestrator.selenium.Selenese; +import org.junit.After; +import org.junit.ClassRule; +import org.junit.Test; + +import static util.ItUtils.projectDir; + +public class I18nTest { + + @ClassRule + public static Orchestrator orchestrator = AdministrationTestSuite.ORCHESTRATOR; + + @After + public void cleanDatabase() { + orchestrator.resetData(); + } + + /** + * TODO This test should use a fake widget that display a fake metric with decimals instead of using provided metric + */ + @Test + public void test_localization() { + orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); + + Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("ui-i18n", + "/ui/i18n/default-locale-is-english.html", + "/ui/i18n/french-locale.html", + "/ui/i18n/french-pack.html", + "/ui/i18n/locale-with-france-country.html", + "/ui/i18n/locale-with-swiss-country.html").build(); + orchestrator.executeSelenese(selenese); + } + +} diff --git a/it/it-tests/src/test/java/ui/I18nTest.java b/it/it-tests/src/test/java/ui/I18nTest.java deleted file mode 100644 index 4168365bd8a..00000000000 --- a/it/it-tests/src/test/java/ui/I18nTest.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * SonarQube, open source software quality management tool. - * Copyright (C) 2008-2014 SonarSource - * mailto:contact AT sonarsource DOT com - * - * SonarQube 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. - * - * SonarQube 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 ui; - -import com.sonar.orchestrator.Orchestrator; -import com.sonar.orchestrator.build.SonarRunner; -import com.sonar.orchestrator.selenium.Selenese; -import org.junit.After; -import org.junit.ClassRule; -import org.junit.Test; - -import static util.ItUtils.pluginArtifact; -import static util.ItUtils.projectDir; -import static util.ItUtils.xooPlugin; - -public class I18nTest { - - @ClassRule - public static Orchestrator orchestrator = Orchestrator.builderEnv() - .addPlugin(pluginArtifact("l10n-fr-pack")) - .addPlugin(xooPlugin()) - .build(); - - @After - public void cleanDatabase() { - orchestrator.resetData(); - } - - /** - * TODO This test should use a fake widget that display a fake metric with decimals instead of using provided metric - */ - @Test - public void test_localization() { - orchestrator.executeBuild(SonarRunner.create(projectDir("shared/xoo-sample"))); - - Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("ui-i18n", - "/ui/i18n/default-locale-is-english.html", - "/ui/i18n/french-locale.html", - "/ui/i18n/french-pack.html", - "/ui/i18n/locale-with-france-country.html", - "/ui/i18n/locale-with-swiss-country.html").build(); - orchestrator.executeSelenese(selenese); - } - -} diff --git a/it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks b/it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks deleted file mode 100644 index 13234b49dc2..00000000000 Binary files a/it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks and /dev/null differ diff --git a/it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks.txt b/it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks.txt deleted file mode 100644 index ce4a4adfc39..00000000000 --- a/it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks.txt +++ /dev/null @@ -1,3 +0,0 @@ -keytool -genkey -alias tests -keyalg RSA -keystore keystore.jks -keystore password: thepassword -key password for : thetests \ No newline at end of file diff --git a/it/it-tests/src/test/resources/administration/ServerTest/derby-warning.html b/it/it-tests/src/test/resources/administration/ServerTest/derby-warning.html deleted file mode 100644 index 2fac7ea6548..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/derby-warning.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - derby-warning - - - - - - - - - - - - - - - - - - - - - - - - - - -
derby-warning
open/sonar/
assertElementPresentevaluation_warning
assertTextfooterglob:*evaluation*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/hide-jdbc-settings.html b/it/it-tests/src/test/resources/administration/ServerTest/hide-jdbc-settings.html deleted file mode 100644 index e223287d9e4..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/hide-jdbc-settings.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - hide-jdbc-settings - - - - - - - - - - - - - - - - - - - - - -
hide-jdbc-settings
open/sonar/setup/index
assertTextNotPresentjdbc:
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/incompatible-plugin-1.0.jar b/it/it-tests/src/test/resources/administration/ServerTest/incompatible-plugin-1.0.jar deleted file mode 100644 index a998a46bb29..00000000000 Binary files a/it/it-tests/src/test/resources/administration/ServerTest/incompatible-plugin-1.0.jar and /dev/null differ diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings-default-value.html b/it/it-tests/src/test/resources/administration/ServerTest/settings-default-value.html deleted file mode 100644 index 70e59f6de88..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings-default-value.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - settings-default-value - - - - - - - - - - - - - - - - - - - - -
settings-default-value
open/sonar/widget?id=widget-displaying-properties
assertTextsome-propertyaDefaultValue
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/display-license.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/display-license.html deleted file mode 100644 index ec3d5e86821..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/display-license.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - display-license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_typed.license.securedTmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=
clickid=submit_settings
waitForTextblock_typed.license.secured*autocontrol*
assertTextblock_typed.license.secured*Developpers*
assertTextblock_typed.license.secured*2012*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/display-untyped-license.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/display-untyped-license.html deleted file mode 100644 index b824efb36cd..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/display-untyped-license.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - display-untyped-license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_untyped.license.securedTmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=
clicksubmit_settings
waitForTextblock_untyped.license.secured*autocontrol*
assertTextblock_untyped.license.secured*Developpers*
assertTextblock_untyped.license.secured*2012*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/encrypt-text.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/encrypt-text.html deleted file mode 100644 index 521edc1e4de..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/encrypt-text.html +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - encrypt-text - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings?category=security&subcategory=encryption
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
selectFramesettings_iframe
typeid=clear_textclear
clickid=submit_encrypt
waitForVisibleencrypted_text
assertValueencrypted_text{aes}4aQbfYe1lrEjiRzv/ETbyg==
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/general-settings.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/general-settings.html deleted file mode 100644 index e8b6a5554df..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/general-settings.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - settings_on_core_plugins - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
settings_on_core_plugins
open/sonar/sessions/logout
open/sonar/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/sonar/settings/index
assertTextplugins*General*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/generate-secret-key.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/generate-secret-key.html deleted file mode 100644 index 61128b0ec5f..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/generate-secret-key.html +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - generate-secret-key - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings?category=security&subcategory=encryption
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
selectFramesettings_iframe
clickAndWaitlink=secret key can be changed
clicksubmit_generate_secret
waitForVisiblesecret
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/global-extension-property.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/global-extension-property.html deleted file mode 100644 index a96d9ccdc13..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/global-extension-property.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - global-extension-property - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
global-extension-property
open/sonar/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/sonar/settings?category=Settings
assertNotTextpluginsglob:*Hidden*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/hidden-extension-property.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/hidden-extension-property.html deleted file mode 100644 index b1ccfb97130..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/hidden-extension-property.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - hidden-extension-property - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
hidden-extension-property
open/sonar/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/sonar/settings?category=Settings
assertNotTextpluginsglob:*Hidden*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/hide-passwords.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/hide-passwords.html deleted file mode 100644 index 68db3b6a6f7..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/hide-passwords.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - hide-passwords - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings?category=Settings
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
assertTextblock_password*Default*
assertNotTextblock_password*Default*sonar*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/ignore-corrupted-license.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/ignore-corrupted-license.html deleted file mode 100644 index 54c71066f48..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/ignore-corrupted-license.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - ignore-corrupted-license - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_typed.license.securedABCDE
clickid=submit_settings
waitForTextblock_typed.license.secured*Product*-*Organization*-*Expiration*-*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/property_relocation.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/property_relocation.html deleted file mode 100644 index dd35bb04664..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/property_relocation.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - property-relocation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings/index?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
assertTextproperties*sonar.newKey*
assertNotTextproperties*sonar.deprecatedKey*
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/settings/validate-property-type.html b/it/it-tests/src/test/resources/administration/ServerTest/settings/validate-property-type.html deleted file mode 100644 index 6ed955d1ea6..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/settings/validate-property-type.html +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - validate-property-type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
open/sonar/sessions/logout
open/sonar/settings?category=Settings
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_floatabc
typeid=input_integer123
clickid=submit_settings
waitForTextproperties*Not a floating point number*
assertValueinput_integer123
open/sonar/settings?category=Settings
assertValueinput_float
- - diff --git a/it/it-tests/src/test/resources/administration/ServerTest/sonar-secret.txt b/it/it-tests/src/test/resources/administration/ServerTest/sonar-secret.txt deleted file mode 100644 index 65b98c522da..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/sonar-secret.txt +++ /dev/null @@ -1 +0,0 @@ -0PZz+G+f8mjr3sPn4+AhHg== \ No newline at end of file diff --git a/it/it-tests/src/test/resources/administration/ServerTest/url_ending_by_jsp.html b/it/it-tests/src/test/resources/administration/ServerTest/url_ending_by_jsp.html deleted file mode 100644 index 194ed4bd07b..00000000000 --- a/it/it-tests/src/test/resources/administration/ServerTest/url_ending_by_jsp.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - -
open/sonar/dashboard/index/myproject.jsp
assertElementPresentdashboard
- - diff --git a/it/it-tests/src/test/resources/server/HttpsTest/keystore.jks b/it/it-tests/src/test/resources/server/HttpsTest/keystore.jks new file mode 100644 index 00000000000..13234b49dc2 Binary files /dev/null and b/it/it-tests/src/test/resources/server/HttpsTest/keystore.jks differ diff --git a/it/it-tests/src/test/resources/server/HttpsTest/keystore.jks.txt b/it/it-tests/src/test/resources/server/HttpsTest/keystore.jks.txt new file mode 100644 index 00000000000..ce4a4adfc39 --- /dev/null +++ b/it/it-tests/src/test/resources/server/HttpsTest/keystore.jks.txt @@ -0,0 +1,3 @@ +keytool -genkey -alias tests -keyalg RSA -keystore keystore.jks +keystore password: thepassword +key password for : thetests \ No newline at end of file diff --git a/it/it-tests/src/test/resources/server/ServerTest/derby-warning.html b/it/it-tests/src/test/resources/server/ServerTest/derby-warning.html new file mode 100644 index 00000000000..2fac7ea6548 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/derby-warning.html @@ -0,0 +1,35 @@ + + + + + + derby-warning + + + + + + + + + + + + + + + + + + + + + + + + + + +
derby-warning
open/sonar/
assertElementPresentevaluation_warning
assertTextfooterglob:*evaluation*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/hide-jdbc-settings.html b/it/it-tests/src/test/resources/server/ServerTest/hide-jdbc-settings.html new file mode 100644 index 00000000000..e223287d9e4 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/hide-jdbc-settings.html @@ -0,0 +1,30 @@ + + + + + + hide-jdbc-settings + + + + + + + + + + + + + + + + + + + + + +
hide-jdbc-settings
open/sonar/setup/index
assertTextNotPresentjdbc:
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/incompatible-plugin-1.0.jar b/it/it-tests/src/test/resources/server/ServerTest/incompatible-plugin-1.0.jar new file mode 100644 index 00000000000..a998a46bb29 Binary files /dev/null and b/it/it-tests/src/test/resources/server/ServerTest/incompatible-plugin-1.0.jar differ diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings-default-value.html b/it/it-tests/src/test/resources/server/ServerTest/settings-default-value.html new file mode 100644 index 00000000000..70e59f6de88 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings-default-value.html @@ -0,0 +1,29 @@ + + + + + + settings-default-value + + + + + + + + + + + + + + + + + + + + +
settings-default-value
open/sonar/widget?id=widget-displaying-properties
assertTextsome-propertyaDefaultValue
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/display-license.html b/it/it-tests/src/test/resources/server/ServerTest/settings/display-license.html new file mode 100644 index 00000000000..ec3d5e86821 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/display-license.html @@ -0,0 +1,64 @@ + + + + + + display-license + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_typed.license.securedTmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=
clickid=submit_settings
waitForTextblock_typed.license.secured*autocontrol*
assertTextblock_typed.license.secured*Developpers*
assertTextblock_typed.license.secured*2012*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/display-untyped-license.html b/it/it-tests/src/test/resources/server/ServerTest/settings/display-untyped-license.html new file mode 100644 index 00000000000..b824efb36cd --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/display-untyped-license.html @@ -0,0 +1,64 @@ + + + + + + display-untyped-license + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_untyped.license.securedTmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=
clicksubmit_settings
waitForTextblock_untyped.license.secured*autocontrol*
assertTextblock_untyped.license.secured*Developpers*
assertTextblock_untyped.license.secured*2012*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/encrypt-text.html b/it/it-tests/src/test/resources/server/ServerTest/settings/encrypt-text.html new file mode 100644 index 00000000000..521edc1e4de --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/encrypt-text.html @@ -0,0 +1,65 @@ + + + + + + encrypt-text + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings?category=security&subcategory=encryption
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
selectFramesettings_iframe
typeid=clear_textclear
clickid=submit_encrypt
waitForVisibleencrypted_text
assertValueencrypted_text{aes}4aQbfYe1lrEjiRzv/ETbyg==
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/general-settings.html b/it/it-tests/src/test/resources/server/ServerTest/settings/general-settings.html new file mode 100644 index 00000000000..e8b6a5554df --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/general-settings.html @@ -0,0 +1,54 @@ + + + + + + settings_on_core_plugins + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
settings_on_core_plugins
open/sonar/sessions/logout
open/sonar/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/sonar/settings/index
assertTextplugins*General*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/generate-secret-key.html b/it/it-tests/src/test/resources/server/ServerTest/settings/generate-secret-key.html new file mode 100644 index 00000000000..61128b0ec5f --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/generate-secret-key.html @@ -0,0 +1,59 @@ + + + + + + generate-secret-key + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings?category=security&subcategory=encryption
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
selectFramesettings_iframe
clickAndWaitlink=secret key can be changed
clicksubmit_generate_secret
waitForVisiblesecret
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/global-extension-property.html b/it/it-tests/src/test/resources/server/ServerTest/settings/global-extension-property.html new file mode 100644 index 00000000000..a96d9ccdc13 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/global-extension-property.html @@ -0,0 +1,51 @@ + + + + + + global-extension-property + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
global-extension-property
open/sonar/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/sonar/settings?category=Settings
assertNotTextpluginsglob:*Hidden*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/hidden-extension-property.html b/it/it-tests/src/test/resources/server/ServerTest/settings/hidden-extension-property.html new file mode 100644 index 00000000000..b1ccfb97130 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/hidden-extension-property.html @@ -0,0 +1,51 @@ + + + + + + hidden-extension-property + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
hidden-extension-property
open/sonar/sessions/new
typeloginadmin
typepasswordadmin
clickAndWaitcommit
open/sonar/settings?category=Settings
assertNotTextpluginsglob:*Hidden*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/hide-passwords.html b/it/it-tests/src/test/resources/server/ServerTest/settings/hide-passwords.html new file mode 100644 index 00000000000..68db3b6a6f7 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/hide-passwords.html @@ -0,0 +1,49 @@ + + + + + + hide-passwords + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings?category=Settings
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
assertTextblock_password*Default*
assertNotTextblock_password*Default*sonar*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/ignore-corrupted-license.html b/it/it-tests/src/test/resources/server/ServerTest/settings/ignore-corrupted-license.html new file mode 100644 index 00000000000..54c71066f48 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/ignore-corrupted-license.html @@ -0,0 +1,54 @@ + + + + + + ignore-corrupted-license + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_typed.license.securedABCDE
clickid=submit_settings
waitForTextblock_typed.license.secured*Product*-*Organization*-*Expiration*-*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/property_relocation.html b/it/it-tests/src/test/resources/server/ServerTest/settings/property_relocation.html new file mode 100644 index 00000000000..dd35bb04664 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/property_relocation.html @@ -0,0 +1,49 @@ + + + + + + property-relocation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings/index?category=general
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
assertTextproperties*sonar.newKey*
assertNotTextproperties*sonar.deprecatedKey*
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/settings/validate-property-type.html b/it/it-tests/src/test/resources/server/ServerTest/settings/validate-property-type.html new file mode 100644 index 00000000000..6ed955d1ea6 --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/settings/validate-property-type.html @@ -0,0 +1,74 @@ + + + + + + validate-property-type + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
open/sonar/sessions/logout
open/sonar/settings?category=Settings
typeid=loginadmin
typeid=passwordadmin
clickAndWaitname=commit
typeid=input_floatabc
typeid=input_integer123
clickid=submit_settings
waitForTextproperties*Not a floating point number*
assertValueinput_integer123
open/sonar/settings?category=Settings
assertValueinput_float
+ + diff --git a/it/it-tests/src/test/resources/server/ServerTest/sonar-secret.txt b/it/it-tests/src/test/resources/server/ServerTest/sonar-secret.txt new file mode 100644 index 00000000000..65b98c522da --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/sonar-secret.txt @@ -0,0 +1 @@ +0PZz+G+f8mjr3sPn4+AhHg== \ No newline at end of file diff --git a/it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html b/it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html new file mode 100644 index 00000000000..194ed4bd07b --- /dev/null +++ b/it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + +
open/sonar/dashboard/index/myproject.jsp
assertElementPresentdashboard
+ +