From 92ad85d9a740553f4c971b8732b34121dafd5af7 Mon Sep 17 00:00:00 2001 From: David Gageot Date: Mon, 1 Oct 2012 16:18:19 +0200 Subject: SONAR-3529 Property field validation --- .../src/test/java/org/sonar/api/config/PropertyDefinitionTest.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sonar-plugin-api/src/test/java/org/sonar/api/config') 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")) -- cgit v1.2.3