Package org.sonar.api

Examples of org.sonar.api.Properties


    }
    return this;
  }

  private PropertyDefinitions addComponentFromAnnotationProperty(Object component, String defaultCategory) {
    Properties annotations = AnnotationUtils.getAnnotation(component, Properties.class);
    if (annotations != null) {
      for (Property property : annotations.value()) {
        addProperty(property, defaultCategory);
      }
    }
    Property annotation = AnnotationUtils.getAnnotation(component, Property.class);
    if (annotation != null) {
View Full Code Here


    assertThat(def.fields()).isEmpty();
  }

  @Test
  public void should_create_from_annotation() {
    Properties props = AnnotationUtils.getAnnotation(Init.class, Properties.class);
    Property prop = props.value()[0];

    PropertyDefinition def = PropertyDefinition.create(prop);

    assertThat(def.key()).isEqualTo("hello");
    assertThat(def.name()).isEqualTo("Hello");
View Full Code Here

    assertThat(def.fields()).isEmpty();
  }

  @Test
  public void should_create_from_annotation_default_values() {
    Properties props = AnnotationUtils.getAnnotation(DefaultValues.class, Properties.class);
    Property prop = props.value()[0];

    PropertyDefinition def = PropertyDefinition.create(prop);

    assertThat(def.key()).isEqualTo("hello");
    assertThat(def.name()).isEqualTo("Hello");
View Full Code Here

    assertThat(def.fields().get(1).indicativeSize()).isEqualTo(5);
  }

  @Test
  public void should_support_property_sets_from_annotation() {
    Properties props = AnnotationUtils.getAnnotation(WithPropertySet.class, Properties.class);
    Property prop = props.value()[0];

    PropertyDefinition def = PropertyDefinition.create(prop);

    assertThat(def.fields()).hasSize(2);
    assertThat(def.fields().get(0).key()).isEqualTo("first");
View Full Code Here

TOP

Related Classes of org.sonar.api.Properties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.