aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-03 10:14:28 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-03 10:28:52 +0200
commit6db2ab62cedcbd6e203fd9c1e52744923bbff395 (patch)
tree460e621dfd1d1c95af9d764b7c1b5f8d2f35c35c /sonar-plugin-api
parentee925d0a8d31556a37f98b6738e6f767b489e288 (diff)
downloadsonarqube-6db2ab62cedcbd6e203fd9c1e52744923bbff395.tar.gz
sonarqube-6db2ab62cedcbd6e203fd9c1e52744923bbff395.zip
Fix administration section in webapp
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java8
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java11
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java2
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java13
4 files changed, 14 insertions, 20 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java
index e4008f2ecea..114abe3fd27 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/Category.java
@@ -26,7 +26,7 @@ import java.util.Locale;
/**
* @since 3.7
*/
-class Category {
+public class Category {
private final String originalKey;
private final boolean special;
@@ -40,15 +40,15 @@ class Category {
this.special = special;
}
- String originalKey() {
+ public String originalKey() {
return originalKey;
}
- String key() {
+ public String key() {
return StringUtils.lowerCase(originalKey, Locale.ENGLISH);
}
- boolean isSpecial() {
+ public boolean isSpecial() {
return special;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
index 5c20f786866..6a63144abf2 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/PropertyDefinitions.java
@@ -22,13 +22,20 @@ package org.sonar.api.config;
import com.google.common.base.Strings;
import com.google.common.collect.Maps;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.*;
+import org.sonar.api.BatchComponent;
+import org.sonar.api.CoreProperties;
import org.sonar.api.Properties;
+import org.sonar.api.Property;
+import org.sonar.api.ServerComponent;
import org.sonar.api.utils.AnnotationUtils;
import javax.annotation.Nullable;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
/**
* Metadata of all the properties declared by plugins
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java b/sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java
index 05c96078eca..4a1d884b3a7 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/config/SubCategory.java
@@ -22,7 +22,7 @@ package org.sonar.api.config;
/**
* @since 3.7
*/
-class SubCategory extends Category {
+public class SubCategory extends Category {
SubCategory(String originalKey) {
super(originalKey);
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java
index 333b8e15c3e..127e7ea2796 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionsTest.java
@@ -128,12 +128,6 @@ public class PropertyDefinitionsTest {
PropertyDefinition.builder("view").name("View").category("catView").onlyOnQualifiers(Qualifiers.VIEW).build()
);
- assertThat(def.getPropertiesByCategory(null).keySet()).containsOnly("catGlobal1", "catGlobal2");
- assertThat(def.getPropertiesByCategory(Qualifiers.PROJECT).keySet()).containsOnly("catProject");
- assertThat(def.getPropertiesByCategory(Qualifiers.MODULE).keySet()).containsOnly("catModule");
- assertThat(def.getPropertiesByCategory(Qualifiers.VIEW).keySet()).containsOnly("catView");
- assertThat(def.getPropertiesByCategory("Unkown").keySet()).isEmpty();
-
assertThat(def.propertiesByCategory(null).keySet()).contains(new Category("catGlobal1"), new Category("catGlobal2"));
assertThat(def.propertiesByCategory(Qualifiers.PROJECT).keySet()).containsOnly(new Category("catProject"));
assertThat(def.propertiesByCategory(Qualifiers.MODULE).keySet()).containsOnly(new Category("catModule"));
@@ -150,9 +144,6 @@ public class PropertyDefinitionsTest {
PropertyDefinition.builder("global4").name("Global4").category("catGlobal2").build()
);
- assertThat(def.getPropertiesByCategory(null).get("catGlobal1").keySet()).containsOnly("catGlobal1", "sub1", "sub2");
- assertThat(def.getPropertiesByCategory(null).get("catGlobal2").keySet()).containsOnly("catGlobal2");
-
assertThat(def.propertiesByCategory(null).get(new Category("catGlobal1")).keySet()).containsOnly(new SubCategory("catGlobal1"), new SubCategory("sub1"),
new SubCategory("sub2"));
assertThat(def.propertiesByCategory(null).get(new Category("catGlobal2")).keySet()).containsOnly(new SubCategory("catGlobal2"));
@@ -162,10 +153,6 @@ public class PropertyDefinitionsTest {
public void should_group_by_category_on_annotation_plugin() {
PropertyDefinitions def = new PropertyDefinitions(ByCategory.class);
- assertThat(def.getPropertiesByCategory().keySet()).containsOnly("catGlobal1", "catGlobal2");
- assertThat(def.getPropertiesByCategory(Qualifiers.PROJECT).keySet()).containsOnly("catProject");
- assertThat(def.getPropertiesByCategory(Qualifiers.MODULE).keySet()).containsOnly("catModule");
-
assertThat(def.propertiesByCategory(null).keySet()).contains(new Category("catglobal1"), new Category("catglobal2"));
assertThat(def.propertiesByCategory(Qualifiers.PROJECT).keySet()).containsOnly(new Category("catproject"));
assertThat(def.propertiesByCategory(Qualifiers.MODULE).keySet()).containsOnly(new Category("catmodule"));