diff options
author | David Gageot <david@gageot.net> | 2012-10-01 16:18:19 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-10-01 16:36:58 +0200 |
commit | 92ad85d9a740553f4c971b8732b34121dafd5af7 (patch) | |
tree | 3c1c132e09b36c40a17da98645db463ab5a066e9 /sonar-plugin-api/src/test/java/org/sonar/api/config | |
parent | 57c87a64a0a545ad81f3859b57d4962260ef6ee3 (diff) | |
download | sonarqube-92ad85d9a740553f4c971b8732b34121dafd5af7.tar.gz sonarqube-92ad85d9a740553f4c971b8732b34121dafd5af7.zip |
SONAR-3529 Property field validation
Diffstat (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/config')
-rw-r--r-- | sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java index caea3a388b7..3a4fcbea156 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/config/PropertyDefinitionTest.java @@ -81,7 +81,7 @@ public class PropertyDefinitionTest { } @Properties(@Property(key = "hello", name = "Hello", fields = { - @PropertyField(key = "first", name = "First"), + @PropertyField(key = "first", name = "First", description = "Description", options = {"A", "B"}), @PropertyField(key = "second", name = "Second", type = PropertyType.INTEGER)})) static class WithPropertySet { } @@ -96,10 +96,13 @@ public class PropertyDefinitionTest { assertThat(def.getFields()).hasSize(2); assertThat(def.getFields()[0].getKey()).isEqualTo("first"); assertThat(def.getFields()[0].getName()).isEqualTo("First"); + assertThat(def.getFields()[0].getDescription()).isEqualTo("Description"); assertThat(def.getFields()[0].getType()).isEqualTo(PropertyType.STRING); + assertThat(def.getFields()[0].getOptions()).containsOnly("A", "B"); assertThat(def.getFields()[1].getKey()).isEqualTo("second"); assertThat(def.getFields()[1].getName()).isEqualTo("Second"); assertThat(def.getFields()[1].getType()).isEqualTo(PropertyType.INTEGER); + assertThat(def.getFields()[1].getOptions()).isEmpty(); } @Properties(@Property(key = "hello", name = "Hello")) |