]> source.dussan.org Git - sonarqube.git/commitdiff
Move I18n to administration category and refactor administration category
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 27 Jul 2015 11:12:25 +0000 (13:12 +0200)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Mon, 27 Jul 2015 11:48:01 +0000 (13:48 +0200)
56 files changed:
.travis.yml
it/it-tests/src/test/java/administation/HttpsTest.java
it/it-tests/src/test/java/administation/ServerTest.java
it/it-tests/src/test/java/administation/suite/AdministrationTestSuite.java
it/it-tests/src/test/java/administation/suite/BulkDeletionTest.java [deleted file]
it/it-tests/src/test/java/administation/suite/ProjectAdministrationTest.java [deleted file]
it/it-tests/src/test/java/administation/suite/PropertySetsTest.java [deleted file]
it/it-tests/src/test/java/administation/suite/ServerAdministrationTest.java [deleted file]
it/it-tests/src/test/java/administation/suite/SubCategoriesTest.java [deleted file]
it/it-tests/src/test/java/administation/suite/WebServiceTest.java [deleted file]
it/it-tests/src/test/java/administation/suite/administration/BulkDeletionTest.java [new file with mode: 0644]
it/it-tests/src/test/java/administation/suite/administration/ProjectAdministrationTest.java [new file with mode: 0644]
it/it-tests/src/test/java/administation/suite/administration/PropertySetsTest.java [new file with mode: 0644]
it/it-tests/src/test/java/administation/suite/administration/SubCategoriesTest.java [new file with mode: 0644]
it/it-tests/src/test/java/administation/suite/administration/WebServiceTest.java [new file with mode: 0644]
it/it-tests/src/test/java/administation/suite/server/ServerAdministrationTest.java [new file with mode: 0644]
it/it-tests/src/test/java/administation/suite/ui/I18nTest.java [new file with mode: 0644]
it/it-tests/src/test/java/ui/I18nTest.java [deleted file]
it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks [deleted file]
it/it-tests/src/test/resources/administration/HttpsTest/keystore.jks.txt [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/derby-warning.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/hide-jdbc-settings.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/incompatible-plugin-1.0.jar [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings-default-value.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/display-license.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/display-untyped-license.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/encrypt-text.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/general-settings.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/generate-secret-key.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/global-extension-property.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/hidden-extension-property.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/hide-passwords.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/ignore-corrupted-license.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/property_relocation.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/settings/validate-property-type.html [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/sonar-secret.txt [deleted file]
it/it-tests/src/test/resources/administration/ServerTest/url_ending_by_jsp.html [deleted file]
it/it-tests/src/test/resources/server/HttpsTest/keystore.jks [new file with mode: 0644]
it/it-tests/src/test/resources/server/HttpsTest/keystore.jks.txt [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/derby-warning.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/hide-jdbc-settings.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/incompatible-plugin-1.0.jar [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings-default-value.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/display-license.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/display-untyped-license.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/encrypt-text.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/general-settings.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/generate-secret-key.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/global-extension-property.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/hidden-extension-property.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/hide-passwords.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/ignore-corrupted-license.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/property_relocation.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/settings/validate-property-type.html [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/sonar-secret.txt [new file with mode: 0644]
it/it-tests/src/test/resources/server/ServerTest/url_ending_by_jsp.html [new file with mode: 0644]

index 4df94489435de77a2a878bfcb1ae622dc6c9eabe..d10e4f8aaf571ff147d1bdf51997de053afc7012 100644 (file)
@@ -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:
index 1f77039e86903dcfd1e45f0d7aece11a90fa3787..5a5b26de4050ee68e6dae208f1047dd9d7563383 100644 (file)
@@ -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")
index 0598dccc0b1b3d7aec897e92ec4ce7e7289c3148..b3117821913ab736c9aa2f4d162d51c330736ff3 100644 (file)
@@ -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);
   }
 
index e91265dd0638ce656b7cd08b91fb988cd6a5fc6b..57f36e793cc8544f1983e2178bcbb2280eab3071 100644 (file)
  */
 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 (file)
index 567b07d..0000000
+++ /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 (file)
index 1370eae..0000000
+++ /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 (file)
index 3ef89bb..0000000
+++ /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 (file)
index 20e15be..0000000
+++ /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 (file)
index 9541385..0000000
+++ /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 (file)
index 85c4394..0000000
+++ /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<Favourite> 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<String> keys = newArrayList(Iterables.transform(favourites, new Function<Favourite, String>() {
-      @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 (file)
index 0000000..963a23b
--- /dev/null
@@ -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 (file)
index 0000000..cc405f0
--- /dev/null
@@ -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 (file)
index 0000000..007eac6
--- /dev/null
@@ -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 (file)
index 0000000..fc4b869
--- /dev/null
@@ -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 (file)
index 0000000..d0d2b01
--- /dev/null
@@ -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<Favourite> 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<String> keys = newArrayList(Iterables.transform(favourites, new Function<Favourite, String>() {
+      @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 (file)
index 0000000..b023d8e
--- /dev/null
@@ -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 (file)
index 0000000..1a5e3d8
--- /dev/null
@@ -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 (file)
index 4168365..0000000
+++ /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 (file)
index 13234b4..0000000
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 (file)
index ce4a4ad..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-keytool -genkey -alias tests -keyalg RSA -keystore keystore.jks
-keystore password: thepassword
-key password for <tests>: 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 (file)
index 2fac7ea..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>derby-warning</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">derby-warning</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementPresent</td>
-        <td>evaluation_warning</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertText</td>
-        <td>footer</td>
-        <td>glob:*evaluation*</td>
-    </tr>
-
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index e223287..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>hide-jdbc-settings</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">hide-jdbc-settings</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/setup/index</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertTextNotPresent</td>
-        <td>jdbc:</td>
-        <td></td>
-    </tr>
-
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index a998a46..0000000
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 (file)
index 70e59f6..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>settings-default-value</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">settings-default-value</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-  <td>open</td>
-  <td>/sonar/widget?id=widget-displaying-properties</td>
-  <td></td>
-</tr>
-<tr>
-  <td>assertText</td>
-  <td>some-property</td>
-  <td>aDefaultValue</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
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 (file)
index ec3d5e8..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>display-license</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/logout</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=general</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>name=commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=input_typed.license.secured</td>
-        <td>TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=</td>
-    </tr>
-    <tr>
-        <td>click</td>
-        <td>id=submit_settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForText</td>
-        <td>block_typed.license.secured</td>
-        <td>*autocontrol*</td>
-    </tr>
-    <tr>
-        <td>assertText</td>
-        <td>block_typed.license.secured</td>
-        <td>*Developpers*</td>
-    </tr>
-    <tr>
-        <td>assertText</td>
-        <td>block_typed.license.secured</td>
-        <td>*2012*</td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index b824efb..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>display-untyped-license</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/logout</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=general</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>name=commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=input_untyped.license.secured</td>
-        <td>TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=</td>
-    </tr>
-    <tr>
-        <td>click</td>
-        <td>submit_settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForText</td>
-        <td>block_untyped.license.secured</td>
-        <td>*autocontrol*</td>
-    </tr>
-    <tr>
-        <td>assertText</td>
-        <td>block_untyped.license.secured</td>
-        <td>*Developpers*</td>
-    </tr>
-    <tr>
-        <td>assertText</td>
-        <td>block_untyped.license.secured</td>
-        <td>*2012*</td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index 521edc1..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>encrypt-text</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/logout</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=security&subcategory=encryption</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>name=commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>selectFrame</td>
-        <td>settings_iframe</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=clear_text</td>
-        <td>clear</td>
-    </tr>
-    <tr>
-        <td>click</td>
-        <td>id=submit_encrypt</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForVisible</td>
-        <td>encrypted_text</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertValue</td>
-        <td>encrypted_text</td>
-        <td>{aes}4aQbfYe1lrEjiRzv/ETbyg==</td>
-    </tr>
-
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index e8b6a55..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>settings_on_core_plugins</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">settings_on_core_plugins</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/sonar/sessions/logout</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sonar/sessions/new</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>login</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>password</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sonar/settings/index</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>plugins</td>
-       <td>*General*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
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 (file)
index 61128b0..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>generate-secret-key</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/logout</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=security&subcategory=encryption</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>name=commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>selectFrame</td>
-        <td>settings_iframe</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>link=secret key can be changed</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>click</td>
-        <td>submit_generate_secret</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForVisible</td>
-        <td>secret</td>
-        <td></td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index a96d9cc..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>global-extension-property</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">global-extension-property</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/new</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>commit</td>
-        <td></td>
-    </tr>
-
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=Settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertNotText</td>
-        <td>plugins</td>
-        <td>glob:*Hidden*</td>
-    </tr>
-
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index b1ccfb9..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>hidden-extension-property</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <thead>
-    <tr>
-        <td rowspan="1" colspan="3">hidden-extension-property</td>
-    </tr>
-    </thead>
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/new</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>commit</td>
-        <td></td>
-    </tr>
-
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=Settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertNotText</td>
-        <td>plugins</td>
-        <td>glob:*Hidden*</td>
-    </tr>
-
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index 68db3b6..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>hide-passwords</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/logout</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=Settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>name=commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertText</td>
-        <td>block_password</td>
-        <td>*Default*</td>
-    </tr>
-    <tr>
-        <td>assertNotText</td>
-        <td>block_password</td>
-        <td>*Default*sonar*</td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index 54c7106..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>ignore-corrupted-license</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/logout</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=general</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>name=commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=input_typed.license.secured</td>
-        <td>ABCDE</td>
-    </tr>
-    <tr>
-        <td>click</td>
-        <td>id=submit_settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForText</td>
-        <td>block_typed.license.secured</td>
-        <td>*Product*-*Organization*-*Expiration*-*</td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index dd35bb0..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>property-relocation</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-       <td>open</td>
-       <td>/sonar/sessions/logout</td>
-       <td></td>
-</tr>
-<tr>
-       <td>open</td>
-       <td>/sonar/settings/index?category=general</td>
-       <td></td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=login</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>type</td>
-       <td>id=password</td>
-       <td>admin</td>
-</tr>
-<tr>
-       <td>clickAndWait</td>
-       <td>name=commit</td>
-       <td></td>
-</tr>
-<tr>
-       <td>assertText</td>
-       <td>properties</td>
-       <td>*sonar.newKey*</td>
-</tr>
-<tr>
-       <td>assertNotText</td>
-       <td>properties</td>
-       <td>*sonar.deprecatedKey*</td>
-</tr>
-</tbody>
-</table>
-</body>
-</html>
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 (file)
index 6ed955d..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>validate-property-type</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/sessions/logout</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=Settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=login</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=password</td>
-        <td>admin</td>
-    </tr>
-    <tr>
-        <td>clickAndWait</td>
-        <td>name=commit</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=input_float</td>
-        <td>abc</td>
-    </tr>
-    <tr>
-        <td>type</td>
-        <td>id=input_integer</td>
-        <td>123</td>
-    </tr>
-    <tr>
-        <td>click</td>
-        <td>id=submit_settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>waitForText</td>
-        <td>properties</td>
-        <td>*Not a floating point number*</td>
-    </tr>
-    <tr>
-        <td>assertValue</td>
-        <td>input_integer</td>
-        <td>123</td>
-    </tr>
-    <tr>
-        <td>open</td>
-        <td>/sonar/settings?category=Settings</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertValue</td>
-        <td>input_float</td>
-        <td></td>
-    </tr>
-    </tbody>
-</table>
-</body>
-</html>
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 (file)
index 65b98c5..0000000
+++ /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 (file)
index 194ed4b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-    <tbody>
-    <tr>
-        <td>open</td>
-        <td>/sonar/dashboard/index/myproject.jsp</td>
-        <td></td>
-    </tr>
-    <tr>
-        <td>assertElementPresent</td>
-        <td>dashboard</td>
-        <td></td>
-    </tr>
-</table>
-</body>
-</html>
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 (file)
index 0000000..13234b4
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 (file)
index 0000000..ce4a4ad
--- /dev/null
@@ -0,0 +1,3 @@
+keytool -genkey -alias tests -keyalg RSA -keystore keystore.jks
+keystore password: thepassword
+key password for <tests>: 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 (file)
index 0000000..2fac7ea
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>derby-warning</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">derby-warning</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertElementPresent</td>
+        <td>evaluation_warning</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>footer</td>
+        <td>glob:*evaluation*</td>
+    </tr>
+
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..e223287
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>hide-jdbc-settings</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">hide-jdbc-settings</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/setup/index</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertTextNotPresent</td>
+        <td>jdbc:</td>
+        <td></td>
+    </tr>
+
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..a998a46
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 (file)
index 0000000..70e59f6
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>settings-default-value</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">settings-default-value</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+  <td>open</td>
+  <td>/sonar/widget?id=widget-displaying-properties</td>
+  <td></td>
+</tr>
+<tr>
+  <td>assertText</td>
+  <td>some-property</td>
+  <td>aDefaultValue</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..ec3d5e8
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>display-license</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=general</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=input_typed.license.secured</td>
+        <td>TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>id=submit_settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>block_typed.license.secured</td>
+        <td>*autocontrol*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>block_typed.license.secured</td>
+        <td>*Developpers*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>block_typed.license.secured</td>
+        <td>*2012*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..b824efb
--- /dev/null
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>display-untyped-license</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=general</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=input_untyped.license.secured</td>
+        <td>TmFtZTogRGV2ZWxvcHBlcnMKUGx1Z2luOiBhdXRvY29udHJvbApFeHBpcmVzOiAyMDEyLTA0LTAxCktleTogNjI5N2MxMzEwYzg2NDZiZTE5MDU1MWE4ZmZmYzk1OTBmYzEyYTIyMgo=</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>submit_settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>block_untyped.license.secured</td>
+        <td>*autocontrol*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>block_untyped.license.secured</td>
+        <td>*Developpers*</td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>block_untyped.license.secured</td>
+        <td>*2012*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..521edc1
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>encrypt-text</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=security&subcategory=encryption</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>selectFrame</td>
+        <td>settings_iframe</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=clear_text</td>
+        <td>clear</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>id=submit_encrypt</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>encrypted_text</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertValue</td>
+        <td>encrypted_text</td>
+        <td>{aes}4aQbfYe1lrEjiRzv/ETbyg==</td>
+    </tr>
+
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..e8b6a55
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>settings_on_core_plugins</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">settings_on_core_plugins</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+       <td>open</td>
+       <td>/sonar/sessions/logout</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sonar/sessions/new</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>login</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>password</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>commit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sonar/settings/index</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>plugins</td>
+       <td>*General*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..61128b0
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>generate-secret-key</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=security&subcategory=encryption</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>selectFrame</td>
+        <td>settings_iframe</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>link=secret key can be changed</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>submit_generate_secret</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForVisible</td>
+        <td>secret</td>
+        <td></td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..a96d9cc
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>global-extension-property</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">global-extension-property</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=Settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertNotText</td>
+        <td>plugins</td>
+        <td>glob:*Hidden*</td>
+    </tr>
+
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..b1ccfb9
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>hidden-extension-property</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <thead>
+    <tr>
+        <td rowspan="1" colspan="3">hidden-extension-property</td>
+    </tr>
+    </thead>
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/new</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>commit</td>
+        <td></td>
+    </tr>
+
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=Settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertNotText</td>
+        <td>plugins</td>
+        <td>glob:*Hidden*</td>
+    </tr>
+
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..68db3b6
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>hide-passwords</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=Settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertText</td>
+        <td>block_password</td>
+        <td>*Default*</td>
+    </tr>
+    <tr>
+        <td>assertNotText</td>
+        <td>block_password</td>
+        <td>*Default*sonar*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..54c7106
--- /dev/null
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>ignore-corrupted-license</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=general</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=input_typed.license.secured</td>
+        <td>ABCDE</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>id=submit_settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>block_typed.license.secured</td>
+        <td>*Product*-*Organization*-*Expiration*-*</td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..dd35bb0
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>property-relocation</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+       <td>open</td>
+       <td>/sonar/sessions/logout</td>
+       <td></td>
+</tr>
+<tr>
+       <td>open</td>
+       <td>/sonar/settings/index?category=general</td>
+       <td></td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>id=login</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>type</td>
+       <td>id=password</td>
+       <td>admin</td>
+</tr>
+<tr>
+       <td>clickAndWait</td>
+       <td>name=commit</td>
+       <td></td>
+</tr>
+<tr>
+       <td>assertText</td>
+       <td>properties</td>
+       <td>*sonar.newKey*</td>
+</tr>
+<tr>
+       <td>assertNotText</td>
+       <td>properties</td>
+       <td>*sonar.deprecatedKey*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..6ed955d
--- /dev/null
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <title>validate-property-type</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/sessions/logout</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=Settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=login</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=password</td>
+        <td>admin</td>
+    </tr>
+    <tr>
+        <td>clickAndWait</td>
+        <td>name=commit</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=input_float</td>
+        <td>abc</td>
+    </tr>
+    <tr>
+        <td>type</td>
+        <td>id=input_integer</td>
+        <td>123</td>
+    </tr>
+    <tr>
+        <td>click</td>
+        <td>id=submit_settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>waitForText</td>
+        <td>properties</td>
+        <td>*Not a floating point number*</td>
+    </tr>
+    <tr>
+        <td>assertValue</td>
+        <td>input_integer</td>
+        <td>123</td>
+    </tr>
+    <tr>
+        <td>open</td>
+        <td>/sonar/settings?category=Settings</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertValue</td>
+        <td>input_float</td>
+        <td></td>
+    </tr>
+    </tbody>
+</table>
+</body>
+</html>
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 (file)
index 0000000..65b98c5
--- /dev/null
@@ -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 (file)
index 0000000..194ed4b
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+    <tbody>
+    <tr>
+        <td>open</td>
+        <td>/sonar/dashboard/index/myproject.jsp</td>
+        <td></td>
+    </tr>
+    <tr>
+        <td>assertElementPresent</td>
+        <td>dashboard</td>
+        <td></td>
+    </tr>
+</table>
+</body>
+</html>