Search in sources :

Example 1 with JavadocDescription

use of com.github.javaparser.javadoc.description.JavadocDescription in project javaparser by javaparser.

the class JavadocTest method toCommentForEmptyJavadoc.

@Test
public void toCommentForEmptyJavadoc() {
    Javadoc javadoc = new Javadoc(new JavadocDescription());
    assertEquals(new JavadocComment("" + EOL + "\t\t "), javadoc.toComment("\t\t"));
}
Also used : JavadocComment(com.github.javaparser.ast.comments.JavadocComment) JavadocDescription(com.github.javaparser.javadoc.description.JavadocDescription) Test(org.junit.Test)

Example 2 with JavadocDescription

use of com.github.javaparser.javadoc.description.JavadocDescription in project javaparser by javaparser.

the class JavadocTest method blockTagModificationWorks.

@Test
public void blockTagModificationWorks() {
    Javadoc javadoc = new Javadoc(new JavadocDescription());
    assertEquals(0, javadoc.getBlockTags().size());
    JavadocBlockTag blockTag = new JavadocBlockTag(JavadocBlockTag.Type.RETURN, "a value");
    javadoc.addBlockTag(blockTag);
    assertEquals(1, javadoc.getBlockTags().size());
    assertEquals(blockTag, javadoc.getBlockTags().get(0));
    assertEquals(blockTag, javadoc.getBlockTags().remove(0));
    assertEquals(0, javadoc.getBlockTags().size());
}
Also used : JavadocDescription(com.github.javaparser.javadoc.description.JavadocDescription) Test(org.junit.Test)

Example 3 with JavadocDescription

use of com.github.javaparser.javadoc.description.JavadocDescription in project javaparser by javaparser.

the class JavadocTest method descriptionModificationWorks.

@Test
public void descriptionModificationWorks() {
    JavadocDescription description = new JavadocDescription();
    assertEquals(0, description.getElements().size());
    JavadocDescriptionElement inlineTag = new JavadocInlineTag("inheritDoc", JavadocInlineTag.Type.INHERIT_DOC, "");
    assertTrue(description.addElement(inlineTag));
    assertEquals(1, description.getElements().size());
    assertEquals(inlineTag, description.getElements().get(0));
    assertEquals(inlineTag, description.getElements().remove(0));
    assertEquals(0, description.getElements().size());
}
Also used : JavadocDescriptionElement(com.github.javaparser.javadoc.description.JavadocDescriptionElement) JavadocInlineTag(com.github.javaparser.javadoc.description.JavadocInlineTag) JavadocDescription(com.github.javaparser.javadoc.description.JavadocDescription) Test(org.junit.Test)

Example 4 with JavadocDescription

use of com.github.javaparser.javadoc.description.JavadocDescription in project javaparser by javaparser.

the class JavadocTest method toTextForEmptyJavadoc.

@Test
public void toTextForEmptyJavadoc() {
    Javadoc javadoc = new Javadoc(new JavadocDescription());
    assertEquals("", javadoc.toText());
}
Also used : JavadocDescription(com.github.javaparser.javadoc.description.JavadocDescription) Test(org.junit.Test)

Aggregations

JavadocDescription (com.github.javaparser.javadoc.description.JavadocDescription)4 Test (org.junit.Test)4 JavadocComment (com.github.javaparser.ast.comments.JavadocComment)1 JavadocDescriptionElement (com.github.javaparser.javadoc.description.JavadocDescriptionElement)1 JavadocInlineTag (com.github.javaparser.javadoc.description.JavadocInlineTag)1