aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2016-11-08 15:11:13 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2016-11-09 16:47:34 +0100
commitf0506597c511931df357d58690e45d872aeba0df (patch)
tree971dc05ab5d4f2175311929b591e36726010c57e /sonar-plugin-api
parent003b0805e5869fa9430ba95a3ac408d30b6a13d8 (diff)
downloadsonarqube-f0506597c511931df357d58690e45d872aeba0df.tar.gz
sonarqube-f0506597c511931df357d58690e45d872aeba0df.zip
SONAR-8355 Remove property 'supportsMeasureFilters' from ResourceType API
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java11
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTest.java28
2 files changed, 10 insertions, 29 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java
index 32768bb68b2..90df4eff818 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/ResourceType.java
@@ -22,12 +22,10 @@ package org.sonar.api.resources;
import com.google.common.base.Preconditions;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
-
+import java.util.Map;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
-import java.util.Map;
-
/**
* <p>Experimental extension to declare types of resources.
* <p>
@@ -156,7 +154,6 @@ public class ResourceType {
* Builder used to create {@link ResourceType} objects.
*/
public static class Builder {
- private static final String SUPPORTS_MEASURE_FILTERS = "supportsMeasureFilters";
private String qualifier;
private String iconPath;
private boolean hasSourceCode = false;
@@ -184,7 +181,6 @@ public class ResourceType {
*/
@Deprecated
public Builder availableForFilters() {
- setProperty(SUPPORTS_MEASURE_FILTERS, "true");
return this;
}
@@ -205,11 +201,6 @@ public class ResourceType {
Preconditions.checkNotNull(key);
Preconditions.checkNotNull(value);
properties.put(key, value);
-
- // for backward-compatibility since version 3.4
- if ("availableForFilters".equals(key)) {
- properties.put(SUPPORTS_MEASURE_FILTERS, value);
- }
return this;
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTest.java
index 1097b0d24e4..1e50d5b0cba 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/resources/ResourceTypeTest.java
@@ -46,7 +46,6 @@ public class ResourceTypeTest {
assertThat(def.getQualifier()).isEqualTo("qualifier");
assertThat(def.getIconPath()).isEqualTo("/custom-icon.png");
assertThat(def.hasSourceCode()).isTrue();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isTrue();
assertThat(def.getStringProperty("anotherProperty")).isEqualTo("foo");
}
@@ -69,34 +68,25 @@ public class ResourceTypeTest {
}
@Test
- public void testDeprecatedIsAvailableForFiltesCompatibility() {
- ResourceType def = ResourceType.builder("qualifier").build();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isFalse();
-
- def = ResourceType.builder("qualifier").availableForFilters().build();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isTrue();
- }
-
- @Test
public void getBooleanProperty_is_set() {
// set with boolean parameter
- ResourceType def = ResourceType.builder("qualifier").setProperty("supportsMeasureFilters", true).build();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isTrue();
+ ResourceType def = ResourceType.builder("qualifier").setProperty("test", true).build();
+ assertThat(def.getBooleanProperty("test")).isTrue();
- def = ResourceType.builder("qualifier").setProperty("supportsMeasureFilters", false).build();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isFalse();
+ def = ResourceType.builder("qualifier").setProperty("test", false).build();
+ assertThat(def.getBooleanProperty("test")).isFalse();
- def = ResourceType.builder("qualifier").setProperty("supportsMeasureFilters", "true").build();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isTrue();
+ def = ResourceType.builder("qualifier").setProperty("test", "true").build();
+ assertThat(def.getBooleanProperty("test")).isTrue();
- def = ResourceType.builder("qualifier").setProperty("supportsMeasureFilters", "false").build();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isFalse();
+ def = ResourceType.builder("qualifier").setProperty("test", "false").build();
+ assertThat(def.getBooleanProperty("test")).isFalse();
}
@Test
public void getBooleanProperty_is_not_set() {
ResourceType def = ResourceType.builder("qualifier").build();
- assertThat(def.getBooleanProperty("supportsMeasureFilters")).isFalse();
+ assertThat(def.getBooleanProperty("test")).isFalse();
}
@Test