aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-12-04 13:18:06 +0100
committerSimon Brandhof <simon.brandhof@gmail.com>2012-12-04 13:18:19 +0100
commitb22c1fdba382d361c9c59deba0a45d7d7d00ca95 (patch)
tree11e35e73987b66a03f516ef1aa3c1c640320b5a9 /sonar-plugin-api
parent44b9092bed4ebdd6cf213da6a6b01c1d0ff030a5 (diff)
downloadsonarqube-b22c1fdba382d361c9c59deba0a45d7d7d00ca95.tar.gz
sonarqube-b22c1fdba382d361c9c59deba0a45d7d7d00ca95.zip
SONAR-3825 delete old mechanism of measure filters
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/Criterion.java10
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/web/CriterionTest.java14
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/web/FilterTest.java4
4 files changed, 15 insertions, 15 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Criterion.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Criterion.java
index abd70585aab..4b4dc7c2bb4 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Criterion.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/Criterion.java
@@ -32,11 +32,11 @@ import java.util.Set;
* @since 3.1
*/
public final class Criterion {
- public static final String EQ = "=";
- public static final String GT = ">";
- public static final String GTE = ">=";
- public static final String LT = "<";
- public static final String LTE = "<=";
+ public static final String EQ = "eq";
+ public static final String GT = "gt";
+ public static final String GTE = "gte";
+ public static final String LT = "lt";
+ public static final String LTE = "lte";
public static final Set<String> OPERATORS = ImmutableSortedSet.of(EQ, GT, GTE, LT, LTE);
private final String family;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java
index 7c8d4d55c67..acc03cbcaad 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/Filter.java
@@ -130,7 +130,7 @@ public final class Filter {
* @throws IllegalArgumentException if {@code displayAs) is not {@value #LIST} or {@value #TREEMAP}
*/
public Filter setDisplayAs(String displayAs) {
- Preconditions.checkArgument(LIST.equals(displayAs) || TREEMAP.equals(displayAs), "Default period should be either %s or %s, not %s", LIST, TREEMAP, displayAs);
+ Preconditions.checkArgument(LIST.equals(displayAs) || TREEMAP.equals(displayAs), "Default display should be either %s or %s, not %s", LIST, TREEMAP, displayAs);
this.displayAs = displayAs;
return this;
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/CriterionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/CriterionTest.java
index 05097bca1ec..bf85f4be6e7 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/web/CriterionTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/web/CriterionTest.java
@@ -29,18 +29,18 @@ public class CriterionTest {
@Test
public void should_accept_valid_operators() {
- Criterion.createForMetric("", "<=", "", false);
- Criterion.createForMetric("", "<", "", false);
- Criterion.createForMetric("", "=", "", false);
- Criterion.createForMetric("", ">", "", false);
- Criterion.createForMetric("", ">=", "", false);
+ Criterion.createForMetric("", "lte", "", false);
+ Criterion.createForMetric("", "lt", "", false);
+ Criterion.createForMetric("", "eq", "", false);
+ Criterion.createForMetric("", "gt", "", false);
+ Criterion.createForMetric("", "gte", "", false);
}
@Test
public void should_fail_on_invalid_operators() {
exception.expect(IllegalArgumentException.class);
- exception.expectMessage("Valid operators are [<, <=, =, >, >=], not '<>'");
+ exception.expectMessage("Valid operators are [eq, gt, gte, lt, lte], not 'xxx'");
- Criterion.createForMetric("", "<>", "", false);
+ Criterion.createForMetric("", "xxx", "", false);
}
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/FilterTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/FilterTest.java
index 602e5c99b54..dbbd23fa555 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/web/FilterTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/web/FilterTest.java
@@ -70,9 +70,9 @@ public class FilterTest {
}
@Test
- public void should_fail_on_invalid_period() {
+ public void should_fail_on_invalid_display() {
exception.expect(IllegalArgumentException.class);
- exception.expectMessage("Default period should be either list or treemap, not <invalid>");
+ exception.expectMessage("Default display should be either list or treemap, not <invalid>");
Filter.create().setDisplayAs("<invalid>");
}