aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-24 11:49:51 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-07-24 12:22:48 +0200
commit05e45302f2bc7263da1d298bf2ad4178bebdd26f (patch)
treea5492b9b556079df001e486548df96c4439d00bc
parent40f40f2432bcf0874f264d605ef210d05c89bc74 (diff)
downloadsonarqube-05e45302f2bc7263da1d298bf2ad4178bebdd26f.tar.gz
sonarqube-05e45302f2bc7263da1d298bf2ad4178bebdd26f.zip
Add some ITs on measures
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/sonar-project.properties1
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo16
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures2
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/sonar-project.properties1
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo20
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures2
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_a/sonar-project.properties4
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/sonar-project.properties1
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo12
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures2
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/sonar-project.properties1
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo12
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures2
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/module_b/sonar-project.properties4
-rw-r--r--it/it-projects/measure/xoo-multi-modules-sample/sonar-project.properties12
-rw-r--r--it/it-projects/measure/xoo-sample/sonar-project.properties5
-rw-r--r--it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo16
-rw-r--r--it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo.measures11
-rw-r--r--it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo2
-rw-r--r--it/it-tests/src/test/java/measure/CustomMeasuresTest.java120
-rw-r--r--it/it-tests/src/test/java/measure/MeasureFiltersTest.java160
-rw-r--r--it/it-tests/src/test/java/measure/MeasuresTestSuite.java36
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/copy_measure_filter.html134
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/copy_uniqueness_of_name.html139
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/empty_filter.html30
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/initial_search_form.html34
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/link_from_main_header.html40
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_change_columns.html84
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_delete_column.html74
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_move_columns.html74
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_descending_name.html70
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_ncloc.html94
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_widget.html90
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_widget_sort.html144
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/list_widget_warning_if_missing_filter.html24
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/save_with_special_characters.html121
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/search-by-key.html69
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/search-by-name.html69
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/search_for_files.html49
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/search_for_projects.html64
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/should-not-share-filter-when-user-have-no-sharing-permissions.html94
-rw-r--r--it/it-tests/src/test/resources/measure/measure_filters/should-unshare-filter-remove-other-filters-favourite.html249
42 files changed, 2187 insertions, 1 deletions
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/sonar-project.properties b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/sonar-project.properties
new file mode 100644
index 00000000000..a081a0e6342
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/sonar-project.properties
@@ -0,0 +1 @@
+sonar.projectName=Sub-module A1
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo
new file mode 100644
index 00000000000..74d29a4fa08
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo
@@ -0,0 +1,16 @@
+package com.sonar.it.samples.modules.a1;
+
+public class HelloA1 {
+ private int i;
+ private HelloA1() {
+
+ }
+
+ public void hello() {
+ System.out.println("hello" + " xoo");
+ }
+
+ protected String getHello() {
+ return "hello";
+ }
+} \ No newline at end of file
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures
new file mode 100644
index 00000000000..7812e4167fb
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a1/src/main/xoo/com/sonar/it/samples/modules/a1/HelloA1.xoo.measures
@@ -0,0 +1,2 @@
+ncloc:12
+classes:1
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/sonar-project.properties b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/sonar-project.properties
new file mode 100644
index 00000000000..fcedab83843
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/sonar-project.properties
@@ -0,0 +1 @@
+sonar.projectName=Sub-module A2
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo
new file mode 100644
index 00000000000..796d90cfad5
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo
@@ -0,0 +1,20 @@
+package com.sonar.it.samples.modules.a2;
+
+public class HelloA2 {
+
+ public HelloA2(int i) {
+ int j = i++;
+ }
+
+ public void hello() {
+ System.out.println("hello" + " xoo");
+ }
+
+ private String myMethod() {
+ if (foo == bar) {
+ return "hello";
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures
new file mode 100644
index 00000000000..63df5add6d4
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_a/module_a2/src/main/xoo/com/sonar/it/samples/modules/a2/HelloA2.xoo.measures
@@ -0,0 +1,2 @@
+ncloc:15
+classes:1
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_a/sonar-project.properties b/it/it-projects/measure/xoo-multi-modules-sample/module_a/sonar-project.properties
new file mode 100644
index 00000000000..7e6ca9074a4
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_a/sonar-project.properties
@@ -0,0 +1,4 @@
+sonar.projectKey=module_a
+sonar.projectName=Module A
+
+sonar.modules=module_a1,module_a2
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/sonar-project.properties b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/sonar-project.properties
new file mode 100644
index 00000000000..ca8404b7bd4
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/sonar-project.properties
@@ -0,0 +1 @@
+sonar.projectName=Sub-module B1
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo
new file mode 100644
index 00000000000..b83c3af128c
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo
@@ -0,0 +1,12 @@
+package com.sonar.it.samples.modules.b1;
+
+public class HelloB1 {
+ private int i;
+ private HelloB1() {
+
+ }
+
+ public void hello() {
+ System.out.println("hello" + " world");
+ }
+} \ No newline at end of file
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures
new file mode 100644
index 00000000000..3947d3bdbff
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b1/src/main/xoo/com/sonar/it/samples/modules/b1/HelloB1.xoo.measures
@@ -0,0 +1,2 @@
+ncloc:12
+classes:1 \ No newline at end of file
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/sonar-project.properties b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/sonar-project.properties
new file mode 100644
index 00000000000..e597dab4f33
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/sonar-project.properties
@@ -0,0 +1 @@
+sonar.projectName=Sub-module B2
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo
new file mode 100644
index 00000000000..20b8bb3876a
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo
@@ -0,0 +1,12 @@
+package com.sonar.it.samples.modules.b2;
+
+public class HelloB2 {
+ private int i;
+ private HelloB2() {
+
+ }
+
+ public void hello() {
+ System.out.println("hello" + " world");
+ }
+} \ No newline at end of file
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures
new file mode 100644
index 00000000000..3947d3bdbff
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_b/module_b2/src/main/xoo/com/sonar/it/samples/modules/b2/HelloB2.xoo.measures
@@ -0,0 +1,2 @@
+ncloc:12
+classes:1 \ No newline at end of file
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/module_b/sonar-project.properties b/it/it-projects/measure/xoo-multi-modules-sample/module_b/sonar-project.properties
new file mode 100644
index 00000000000..21d69f769d3
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/module_b/sonar-project.properties
@@ -0,0 +1,4 @@
+sonar.projectKey=module_b
+sonar.projectName=Module B
+
+sonar.modules=module_b1,module_b2
diff --git a/it/it-projects/measure/xoo-multi-modules-sample/sonar-project.properties b/it/it-projects/measure/xoo-multi-modules-sample/sonar-project.properties
new file mode 100644
index 00000000000..7935cb5ffb0
--- /dev/null
+++ b/it/it-projects/measure/xoo-multi-modules-sample/sonar-project.properties
@@ -0,0 +1,12 @@
+# Root project information
+sonar.projectKey=com.sonarsource.it.samples:multi-modules-sample
+sonar.projectName=Sonar :: Integration Tests :: Multi-modules Sample
+sonar.projectVersion=1.0-SNAPSHOT
+
+sonar.language=xoo
+
+# Some properties that will be inherited by the modules
+sonar.sources=src/main/xoo
+
+# List of the module identifiers
+sonar.modules=module_a,module_b
diff --git a/it/it-projects/measure/xoo-sample/sonar-project.properties b/it/it-projects/measure/xoo-sample/sonar-project.properties
new file mode 100644
index 00000000000..9e4aa0e3584
--- /dev/null
+++ b/it/it-projects/measure/xoo-sample/sonar-project.properties
@@ -0,0 +1,5 @@
+sonar.projectKey=sample
+sonar.projectName=Sample
+sonar.projectVersion=1.0-SNAPSHOT
+sonar.sources=src/main/xoo
+sonar.language=xoo
diff --git a/it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo b/it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo
new file mode 100644
index 00000000000..41871e123a3
--- /dev/null
+++ b/it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo
@@ -0,0 +1,16 @@
+package sample;
+
+public class Sample {
+
+ public Sample(int i) {
+ int j = i++;
+ }
+
+ private String myMethod() {
+ if (foo == bar) {
+ return "hello";
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+}
diff --git a/it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo.measures b/it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo.measures
new file mode 100644
index 00000000000..3f73ea8f695
--- /dev/null
+++ b/it/it-projects/measure/xoo-sample/src/main/xoo/sample/Sample.xoo.measures
@@ -0,0 +1,11 @@
+ncloc:13
+#Used by dashboard/widgets tests
+complexity:3
+complexity_in_classes:3
+classes:1
+comment_lines:3
+public_api:5
+public_undocumented_api:2
+duplicated_files:1
+duplicated_blocks:2
+duplicated_lines:3
diff --git a/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo b/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo
index 41871e123a3..ad246dc8813 100644
--- a/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo
+++ b/it/it-projects/testing/xoo-sample-it-coverage/src/main/xoo/sample/Sample.xoo
@@ -1,4 +1,4 @@
-package sample;
+ackage sample;
public class Sample {
diff --git a/it/it-tests/src/test/java/measure/CustomMeasuresTest.java b/it/it-tests/src/test/java/measure/CustomMeasuresTest.java
new file mode 100644
index 00000000000..c624e62c797
--- /dev/null
+++ b/it/it-tests/src/test/java/measure/CustomMeasuresTest.java
@@ -0,0 +1,120 @@
+/*
+ * 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 measure;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarRunner;
+import com.sonar.orchestrator.selenium.Selenese;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import org.junit.Before;
+import org.junit.ClassRule;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.sonar.wsclient.services.Measure;
+import org.sonar.wsclient.services.Resource;
+import org.sonar.wsclient.services.ResourceQuery;
+import util.ItUtils;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static util.ItUtils.projectDir;
+
+public class CustomMeasuresTest {
+
+ public static final String PROJECT_KEY = "sample";
+ @ClassRule
+ public static Orchestrator orchestrator = MeasuresTestSuite.ORCHESTRATOR;
+
+ @Before
+ public void deleteProjects() {
+ orchestrator.resetData();
+ }
+
+ @Test
+ public void custom_measures_should_be_integrated_during_project_analysis() {
+ analyzeProject();
+ setBurnedBudget(1200.3);
+ setTeamSize(4);
+
+ assertThat(getMeasure("team_size")).isNull();
+ assertThat(getMeasure("burned_budget")).isNull();
+
+ analyzeProject();
+
+ assertThat(getMeasure("burned_budget").getValue()).isEqualTo(1200.3);
+ assertThat(getMeasure("team_size").getIntValue()).isEqualTo(4);
+ }
+
+ @Test
+ public void should_update_value() {
+ analyzeProject();
+ setTeamSize(4);
+ analyzeProject();
+ updateTeamSize(15);
+ assertThat(getMeasure("team_size").getIntValue()).isEqualTo(4);
+ analyzeProject();// the value is available when the project is analyzed again
+ assertThat(getMeasure("team_size").getIntValue()).isEqualTo(15);
+ }
+
+ @Test
+ public void should_delete_custom_measure() {
+ analyzeProject();
+ setTeamSize(4);
+ analyzeProject();
+ deleteCustomMeasure("team_size");
+ assertThat(getMeasure("team_size").getIntValue()).isEqualTo(4);// the value is still available. It will be removed during next analyzed
+
+ analyzeProject();
+ assertThat(getMeasure("team_size")).isNull();
+ }
+
+ private void analyzeProject() {
+ orchestrator.executeBuild(SonarRunner.create(projectDir("measure/xoo-sample")));
+ }
+
+ private void setTeamSize(int i) {
+ orchestrator.getServer().adminWsClient().post("api/custom_measures/create", "projectKey", PROJECT_KEY, "metricKey", "team_size", "value", String.valueOf(i));
+ }
+
+ private void updateTeamSize(int i) {
+ String response = orchestrator.getServer().adminWsClient().get("api/custom_measures/search", "projectKey", PROJECT_KEY, "metricKey", "team_size");
+ Matcher jsonObjectMatcher = Pattern.compile(".*?\"id\"\\s*:\\s*\"(.*?)\".*", Pattern.MULTILINE).matcher(response);
+ jsonObjectMatcher.find();
+ String customMeasureId = jsonObjectMatcher.group(1);
+ orchestrator.getServer().adminWsClient().post("api/custom_measures/update", "id", customMeasureId, "value", String.valueOf(i));
+ }
+
+ private void setBurnedBudget(double d) {
+ orchestrator.getServer().adminWsClient().post("api/custom_measures/create", "projectKey", PROJECT_KEY, "metricKey", "burned_budget", "value", String.valueOf(d));
+ }
+
+ private void deleteCustomMeasure(String metricKey) {
+ String response = orchestrator.getServer().adminWsClient().get("api/custom_measures/search", "projectKey", PROJECT_KEY, "metricKey", metricKey);
+ Matcher jsonObjectMatcher = Pattern.compile(".*?\"id\"\\s*:\\s*\"(.*?)\".*", Pattern.MULTILINE).matcher(response);
+ jsonObjectMatcher.find();
+ String customMeasureId = jsonObjectMatcher.group(1);
+ orchestrator.getServer().adminWsClient().post("api/custom_measures/delete", "id", customMeasureId);
+ }
+
+ private Measure getMeasure(String metricKey) {
+ Resource resource = orchestrator.getServer().getWsClient().find(ResourceQuery.createForMetrics(PROJECT_KEY, metricKey));
+ return resource != null ? resource.getMeasure(metricKey) : null;
+ }
+}
diff --git a/it/it-tests/src/test/java/measure/MeasureFiltersTest.java b/it/it-tests/src/test/java/measure/MeasureFiltersTest.java
new file mode 100644
index 00000000000..ebc5a91a8a9
--- /dev/null
+++ b/it/it-tests/src/test/java/measure/MeasureFiltersTest.java
@@ -0,0 +1,160 @@
+/*
+ * 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 measure;
+
+import com.sonar.orchestrator.Orchestrator;
+import com.sonar.orchestrator.build.SonarRunner;
+import com.sonar.orchestrator.selenium.Selenese;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Test;
+import org.sonar.wsclient.SonarClient;
+import org.sonar.wsclient.permissions.PermissionParameters;
+import org.sonar.wsclient.user.UserParameters;
+
+import static util.ItUtils.projectDir;
+
+public class MeasureFiltersTest {
+
+ @ClassRule
+ public static Orchestrator orchestrator = MeasuresTestSuite.ORCHESTRATOR;
+
+ @BeforeClass
+ public static void scanStruts() {
+ orchestrator.resetData();
+ orchestrator.executeBuild(SonarRunner.create(projectDir("measure/xoo-multi-modules-sample")));
+
+ createUser("user-measure-filters", "User Measure Filters");
+ }
+
+ @AfterClass
+ public static void deleteTestUser() {
+ deactivateUser("user-measure-filters");
+ }
+
+ @Test
+ public void execute_measure_filters() {
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("execution_of_measure_filters",
+ "/measure/measure_filters/link_from_main_header.html",
+ "/measure/measure_filters/initial_search_form.html",
+ "/measure/measure_filters/search_for_projects.html",
+ "/measure/measure_filters/search_for_files.html",
+ // SONAR-4195
+ "/measure/measure_filters/search-by-key.html",
+ "/measure/measure_filters/search-by-name.html",
+ "/measure/measure_filters/empty_filter.html"
+ ).build();
+ orchestrator.executeSelenese(selenese);
+ }
+
+ @Test
+ public void display_measure_filter_as_list() {
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("display_measure_filter_as_list",
+ "/measure/measure_filters/list_change_columns.html",
+ "/measure/measure_filters/list_delete_column.html",
+ "/measure/measure_filters/list_move_columns.html",
+ "/measure/measure_filters/list_sort_by_descending_name.html",
+ "/measure/measure_filters/list_sort_by_ncloc.html"
+ ).build();
+ orchestrator.executeSelenese(selenese);
+ }
+
+ @Test
+ public void share_measure_filters() {
+ // SONAR-4099
+ String user = "user-measures-filter-with-sharing-perm";
+ createUser(user, "User Measure Filters with sharing permission", "shareDashboard");
+
+ try {
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("share_measure_filters",
+ // SONAR-4469
+ "/measure/measure_filters/should-unshare-filter-remove-other-filters-favourite.html"
+ ).build();
+ orchestrator.executeSelenese(selenese);
+
+ } finally {
+ deactivateUser(user);
+ }
+ }
+
+ /**
+ * SONAR-4099
+ */
+ @Test
+ public void should_not_share_filter_when_user_have_no_sharing_permissions() {
+ String user = "user-measures-filter-with-no-share-perm";
+ createUser(user, "User Measure Filters without sharing permission");
+
+ try {
+ orchestrator.executeSelenese(Selenese.builder().setHtmlTestsInClasspath("should_not_share_filter_when_user_have_no_sharing_permissions",
+ "/measure/measure_filters/should-not-share-filter-when-user-have-no-sharing-permissions.html"
+ ).build());
+ } finally {
+ deactivateUser(user);
+ }
+ }
+
+ @Test
+ public void copy_measure_filters() {
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("copy_measure_filters",
+ "/measure/measure_filters/copy_measure_filter.html",
+ "/measure/measure_filters/copy_uniqueness_of_name.html"
+ ).build();
+ orchestrator.executeSelenese(selenese);
+ }
+
+ @Test
+ public void manage_measure_filters() {
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("manage_measure_filters",
+ "/measure/measure_filters/save_with_special_characters.html"
+ ).build();
+ orchestrator.executeSelenese(selenese);
+ }
+
+ @Test
+ public void measure_filter_list_widget() {
+ Selenese selenese = Selenese.builder().setHtmlTestsInClasspath("measure_filter_list_widget",
+ "/measure/measure_filters/list_widget.html",
+ "/measure/measure_filters/list_widget_sort.html",
+ "/measure/measure_filters/list_widget_warning_if_missing_filter.html"
+ ).build();
+ orchestrator.executeSelenese(selenese);
+ }
+
+ private static void createUser(String login, String name) {
+ createUser(login, name, null);
+ }
+
+ private static void createUser(String login, String name, String permission) {
+ SonarClient client = orchestrator.getServer().adminWsClient();
+ UserParameters userCreationParameters = UserParameters.create().login(login).name(name).password("password").passwordConfirmation("password");
+ client.userClient().create(userCreationParameters);
+
+ if (permission != null) {
+ client.permissionClient().addPermission(PermissionParameters.create().user(login).permission(permission));
+ }
+ }
+
+ private static void deactivateUser(String user) {
+ orchestrator.getServer().adminWsClient().userClient().deactivate(user);
+ }
+
+}
diff --git a/it/it-tests/src/test/java/measure/MeasuresTestSuite.java b/it/it-tests/src/test/java/measure/MeasuresTestSuite.java
new file mode 100644
index 00000000000..b0761da96ea
--- /dev/null
+++ b/it/it-tests/src/test/java/measure/MeasuresTestSuite.java
@@ -0,0 +1,36 @@
+/*
+ * 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 measure;
+
+import com.sonar.orchestrator.Orchestrator;
+import org.junit.ClassRule;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import util.ItUtils;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({})
+public class MeasuresTestSuite {
+
+ @ClassRule
+ public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv()
+ .addPlugin(ItUtils.xooPlugin())
+ .build();
+}
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/copy_measure_filter.html b/it/it-tests/src/test/resources/measure/measure_filters/copy_measure_filter.html
new file mode 100644
index 00000000000..22005c9a9d6
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/copy_measure_filter.html
@@ -0,0 +1,134 @@
+<?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>copy_measure_filter</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>storeEval</td>
+ <td>'list_'+(new Date()).getTime()</td>
+ <td>FILTER_NAME</td>
+</tr>
+<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>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>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>save-as-filter-form</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-title</td>
+ <td>*${FILTER_NAME}*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=copy</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>copy-filter-form</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>copy of ${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=description</td>
+ <td>description of copy</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>id=copy-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-title</td>
+ <td>*copy of ${FILTER_NAME}*</td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-description</td>
+ <td>*description of copy*</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+</tr>
+<tr>
+ <td>assertSelectedLabel</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/copy_uniqueness_of_name.html b/it/it-tests/src/test/resources/measure/measure_filters/copy_uniqueness_of_name.html
new file mode 100644
index 00000000000..7f6f914a8a2
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/copy_uniqueness_of_name.html
@@ -0,0 +1,139 @@
+<?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>copy_uniqueness_of_name</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>store</td>
+ <td>javascript{'list_'+(new Date()).getTime()}</td>
+ <td>FILTER_NAME</td>
+</tr>
+<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>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>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>save-as-filter-form</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-title</td>
+ <td>*${FILTER_NAME}*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=copy</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>copy-filter-form</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=copy-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>copy-filter-form</td>
+ <td>*Name already exists*</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>copy of ${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=copy-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-title</td>
+ <td>*copy of ${FILTER_NAME}*</td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+</tr>
+<tr>
+ <td>assertSelectedLabel</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/empty_filter.html b/it/it-tests/src/test/resources/measure/measure_filters/empty_filter.html
new file mode 100644
index 00000000000..65ebe3575ad
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/empty_filter.html
@@ -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>empty_filter</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures/search</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*No data*</td>
+ </tr>
+ <tr>
+ <td>assertNotText</td>
+ <td>measures-table</td>
+ <td>*Struts*</td>
+ </tr>
+
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/initial_search_form.html b/it/it-tests/src/test/resources/measure/measure_filters/initial_search_form.html
new file mode 100644
index 00000000000..863df6c057a
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/initial_search_form.html
@@ -0,0 +1,34 @@
+<?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>initial_search_form</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForText</td>
+ <td>class=navigator-filters</td>
+ <td>*More Criteria*</td>
+ </tr>
+ <tr>
+ <td>assertElementNotPresent</td>
+ <td>measures-table</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/link_from_main_header.html b/it/it-tests/src/test/resources/measure/measure_filters/link_from_main_header.html
new file mode 100644
index 00000000000..c92986d4489
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/link_from_main_header.html
@@ -0,0 +1,40 @@
+<?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>link_from_main_header</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>link=Measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>link=Measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertLocation</td>
+ <td>*/measures*</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertElementPresent</td>
+ <td>class=navigator-filters</td>
+ <td></td>
+ </tr>
+
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_change_columns.html b/it/it-tests/src/test/resources/measure/measure_filters/list_change_columns.html
new file mode 100644
index 00000000000..b23e78ca1c4
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_change_columns.html
@@ -0,0 +1,84 @@
+<?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>configure-table-columns</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=change-display</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>select-metric</td>
+ <td>Complexity</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=add-metric</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Name*Cmpx*</td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>select-metric</td>
+ <td>Comment lines</td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>id=select-period</td>
+ <td>label=since previous analysis</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=add-metric</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Name*Cmpx*Comment lines*last*</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=exit-edit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Name*Cmpx*Comment lines*last*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_delete_column.html b/it/it-tests/src/test/resources/measure/measure_filters/list_delete_column.html
new file mode 100644
index 00000000000..3075d43b47e
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_delete_column.html
@@ -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>delete_column</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=change-display</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Name*Last Analysis*LOC*</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>delete-date</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForText</td>
+ <td>measures-table</td>
+ <td>*Name*LOC*</td>
+ </tr>
+ <tr>
+ <td>assertNotText</td>
+ <td>measures-table</td>
+ <td>*Last Analysis*</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=exit-edit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Name*LOC*</td>
+ </tr>
+ <tr>
+ <td>assertNotText</td>
+ <td>measures-table</td>
+ <td>*Last Analysis*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_move_columns.html b/it/it-tests/src/test/resources/measure/measure_filters/list_move_columns.html
new file mode 100644
index 00000000000..ee78b261c94
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_move_columns.html
@@ -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>move_columns</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=change-display</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Name*Last Analysis*LOC*</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>left-date</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForText</td>
+ <td>measures-table</td>
+ <td>*Last Analysis*Name*LOC*</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>right-name</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForText</td>
+ <td>measures-table</td>
+ <td>*Last Analysis*LOC*Name*</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=exit-edit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Last Analysis*LOC*Name*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_descending_name.html b/it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_descending_name.html
new file mode 100644
index 00000000000..8705a7efee2
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_descending_name.html
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!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>list_sort_by_descending_name</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertElementPresent</td>
+ <td>measures-table</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>link=Name</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*b2/HelloB2.xoo*b1/HelloB1.xoo*a2/HelloA2.xoo*a1/HelloA1.xoo*</td>
+ </tr>
+
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_ncloc.html b/it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_ncloc.html
new file mode 100644
index 00000000000..95ef3b0deeb
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_sort_by_ncloc.html
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!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>list_sort_by_ncloc</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertElementPresent</td>
+ <td>measures-table</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>css=#measures-table tfoot</td>
+ <td>*4 results*</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>link=LOC</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*a2/HelloA2.xoo*a1/HelloA1.xoo*b1/HelloB1.xoo*b2/HelloB2.xoo*</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>css=#measures-table tfoot</td>
+ <td>*4 results*</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>link=LOC</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>css=#measures-table tfoot</td>
+ <td>*4 results*</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*a1/HelloA1.xoo*b1/HelloB1.xoo*b2/HelloB2.xoo*a2/HelloA2.xoo*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_widget.html b/it/it-tests/src/test/resources/measure/measure_filters/list_widget.html
new file mode 100644
index 00000000000..81695821706
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_widget.html
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!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>list_widget</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/measures/manage</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>clickAndWait</td>
+ <td>xpath=(//table[contains(@id, 'shared-filters')]//a[contains(text(),'Projects')])</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>storeEval</td>
+ <td>window.location.pathname.split('/').last()</td>
+ <td>FILTER_ID</td>
+ </tr>
+ <tr>
+ <td>open</td>
+ <td>/sonar/widget?id=measure_filter_list&amp;filter=${FILTER_ID}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>block_1</td>
+ <td>*Name*Version*LOC*Last Analysis*</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>block_1</td>
+ <td>*Multi-modules Sample*1.0-SNAPSHOT*</td>
+ </tr>
+ <tr>
+ <td>assertNotText</td>
+ <td>block_1</td>
+ <td>*Module A*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_widget_sort.html b/it/it-tests/src/test/resources/measure/measure_filters/list_widget_sort.html
new file mode 100644
index 00000000000..82b5f7e6eea
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_widget_sort.html
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!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>list_widget_sort</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>storeEval</td>
+ <td>'sort_widget_'+(new Date()).getTime()</td>
+ <td>FILTER_NAME</td>
+</tr>
+<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>name=commit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>class=navigator-filters</td>
+ <td>*More Criteria*</td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>save-as-filter-form</td>
+ <td></td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>name</td>
+ <td>${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>id=save-as-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>storeEval</td>
+ <td>window.location.pathname.split('/').last()</td>
+ <td>FILTER_ID</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/sonar/widget?id=measure_filter_list&amp;filter=${FILTER_ID}</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>block_1</td>
+ <td>*Name*LOC*</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>block_1</td>
+ <td>*a1/HelloA1.xoo*a2/HelloA2.xoo*b1/HelloB1.xoo*b2/HelloB2.xoo*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=LOC</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>block_1</td>
+ <td>*a2/HelloA2.xoo*a1/HelloA1.xoo*b1/HelloB1.xoo*b2/HelloB2.xoo*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>link=LOC</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>block_1</td>
+ <td>*HelloA1*HelloB1*HelloB2*HelloA2*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/list_widget_warning_if_missing_filter.html b/it/it-tests/src/test/resources/measure/measure_filters/list_widget_warning_if_missing_filter.html
new file mode 100644
index 00000000000..4bcd30c0ba4
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/list_widget_warning_if_missing_filter.html
@@ -0,0 +1,24 @@
+<?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>list_widget</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/widget?id=measure_filter_list</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>block_1</td>
+ <td>*This widget is configured to display a measure filter that does not exist anymore.*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/save_with_special_characters.html b/it/it-tests/src/test/resources/measure/measure_filters/save_with_special_characters.html
new file mode 100644
index 00000000000..19b116782e9
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/save_with_special_characters.html
@@ -0,0 +1,121 @@
+<?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>save_with_special_characters</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/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/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>id=save-as</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>save-as-filter-form</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>special $àé'@&quot;</td>
+ </tr>
+ <tr>
+ <td>type</td>
+ <td>id=description</td>
+ <td>description with special characters &quot; ' éà</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=save-as-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>filter-description</td>
+ <td>*description with special characters &quot; ' éà*</td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>id=manage-favorites</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>id=manage-favorites</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>my-filters</td>
+ <td>*special $àé'@&quot;*description with special characters &quot; ' éà*</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>id=delete_special-ae</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>confirm-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>id=confirm-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForNotText</td>
+ <td>my-filters</td>
+ <td>*special $àé'@&quot;*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
+
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/search-by-key.html b/it/it-tests/src/test/resources/measure/measure_filters/search-by-key.html
new file mode 100644
index 00000000000..50fce19e151
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/search-by-key.html
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!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>search-by-key</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Projects</td>
+ </tr>
+ <tr>
+ <td>type</td>
+ <td>name=keySearch</td>
+ <td>multi-modules</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Sonar :: Integration Tests :: Multi-modules Sample*</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>css=#measures-table tfoot</td>
+ <td>*1 results*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/search-by-name.html b/it/it-tests/src/test/resources/measure/measure_filters/search-by-name.html
new file mode 100644
index 00000000000..2c4fb8c53d3
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/search-by-name.html
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!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>search-by-name</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Projects</td>
+ </tr>
+ <tr>
+ <td>type</td>
+ <td>name=nameSearch</td>
+ <td>Integration</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Sonar :: Integration Tests :: Multi-modules Sample*</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>css=#measures-table tfoot</td>
+ <td>*1 results*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/search_for_files.html b/it/it-tests/src/test/resources/measure/measure_filters/search_for_files.html
new file mode 100644
index 00000000000..4e001a597c9
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/search_for_files.html
@@ -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>search_for_files</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Files</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*a1/HelloA1.xoo*a2/HelloA2.xoo*b1/HelloB1.xoo*b2/HelloB2.xoo*</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>css=#measures-table tfoot</td>
+ <td>*4 results*</td>
+ </tr>
+ <tr>
+ <td>assertNotText</td>
+ <td>measures-table</td>
+ <td>*Module A*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/search_for_projects.html b/it/it-tests/src/test/resources/measure/measure_filters/search_for_projects.html
new file mode 100644
index 00000000000..c7c0e83bdb2
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/search_for_projects.html
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ 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.
+ -->
+
+<!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>search_for_projects_by_default</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+ <tbody>
+ <tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Projects</td>
+ </tr>
+ <tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertElementPresent</td>
+ <td>measures-table</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>measures-table</td>
+ <td>*Sonar :: Integration Tests :: Multi-modules Sample*</td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/should-not-share-filter-when-user-have-no-sharing-permissions.html b/it/it-tests/src/test/resources/measure/measure_filters/should-not-share-filter-when-user-have-no-sharing-permissions.html
new file mode 100644
index 00000000000..94f85a0e3c5
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/should-not-share-filter-when-user-have-no-sharing-permissions.html
@@ -0,0 +1,94 @@
+<?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>should_save_issue_filters</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<tbody>
+<tr>
+ <td>storeEval</td>
+ <td>'filter_'+(new Date()).getTime()</td>
+ <td>FILTER_NAME</td>
+</tr>
+<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>user-measures-filter-with-no-share-perm</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>password</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>commit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Projects</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>save-as-filter-form</td>
+ <td>*Save Filter*</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>user_${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>assertNotText</td>
+ <td>save-as-filter-form</td>
+ <td>*Shared with all users*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-title</td>
+ <td>*user_${FILTER_NAME}*Private*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>
diff --git a/it/it-tests/src/test/resources/measure/measure_filters/should-unshare-filter-remove-other-filters-favourite.html b/it/it-tests/src/test/resources/measure/measure_filters/should-unshare-filter-remove-other-filters-favourite.html
new file mode 100644
index 00000000000..8b6fb44c4e5
--- /dev/null
+++ b/it/it-tests/src/test/resources/measure/measure_filters/should-unshare-filter-remove-other-filters-favourite.html
@@ -0,0 +1,249 @@
+<?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>should_save_issue_filters</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<tbody>
+<tr>
+ <td>storeEval</td>
+ <td>'filter_'+(new Date()).getTime()</td>
+ <td>FILTER_NAME</td>
+</tr>
+<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>user-measures-filter-with-sharing-perm</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>password</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>commit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>name=qualifiers[]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>select</td>
+ <td>name=qualifiers[]</td>
+ <td>Projects</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>class=navigator-filter-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>save-as-filter-form</td>
+ <td>*Save Filter*</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>id=name</td>
+ <td>user_${FILTER_NAME}</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=shared</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=save-as-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-title</td>
+ <td>*user_${FILTER_NAME}*Shared with all users*</td>
+</tr>
+<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/measures/manage</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>content</td>
+ <td>*My Measures Filters*</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>shared-filters</td>
+ <td>*user_${FILTER_NAME}*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=star-user_${FILTER_NAME}</td>
+ <td></td>
+</tr>
+<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>user-measures-filter-with-sharing-perm</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>password</td>
+ <td>password</td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>commit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/sonar/measures</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>id=manage-favorites</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>id=manage-favorites</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>my-filters</td>
+ <td>*user_${FILTER_NAME}*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>id=edit_user_${FILTER_NAME}</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>edit-filter-form</td>
+ <td>*Edit Filter*</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>shared</td>
+ <td></td>
+</tr>
+<tr>
+ <td>clickAndWait</td>
+ <td>id=save-submit</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>filter-title</td>
+ <td>*user_${FILTER_NAME}*Private*</td>
+</tr>
+<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/measures/manage</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForText</td>
+ <td>content</td>
+ <td>*My Measures Filters*</td>
+</tr>
+<tr>
+ <td>assertNotText</td>
+ <td>shared-filters</td>
+ <td>*user_${FILTER_NAME}*</td>
+</tr>
+</tbody>
+</table>
+</body>
+</html>