Exemplo n.º 1
0
  @Test
  public void descriptionAppearsInFieldJavadoc() throws IOException {

    JavaField javaField = classWithTitle.getFieldByName("title");
    String javaDocComment = javaField.getComment();

    assertThat(javaDocComment, containsString("A title for this property"));
  }
Exemplo n.º 2
0
  @Test
  public void titleAppearsBeforeDescriptionInJavadoc() throws IOException {

    JavaField javaField = classWithTitle.getFieldByName("titleAndDescription");
    String javaDocComment = javaField.getComment();

    assertThat(javaDocComment, containsString("A description for this property"));
    assertThat(
        javaDocComment.indexOf("A title for this property"),
        is(lessThan(javaDocComment.indexOf("A description for this property"))));
  }
  private void buildPropertyCollection() {
    this.properties = new ArrayList<JavaProperty>();

    BeanProperty[] properties = javaClass.getBeanProperties(true);
    for (int i = 0; i < properties.length; i++) {
      if (isValidProperty(properties[i])) {
        com.thoughtworks.qdox.model.JavaField field =
            javaClass.getFieldByName(properties[i].getName());
        this.properties.add(new QDoxPropertyAdapter(properties[i], field));
      }
    }
  }