Search in sources :

Example 11 with AbstractInlineTagDefinition

use of org.eclipse.n4js.jsdoc.tags.AbstractInlineTagDefinition in project n4js by eclipse.

the class DocletParserTest method testJSDocParsingWithoutMainDescription.

@SuppressWarnings("javadoc")
@Test
public void testJSDocParsingWithoutMainDescription() {
    String in = "/** \n * @stubLineTagTitle \n */";
    AbstractLineTagDefinition tag = new StubLineTagDefinition("stubLineTagTitle");
    DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tag)), new TagDictionary<AbstractInlineTagDefinition>());
    Doclet doclet = docletParser.parse(in);
    LineTag lineTag = doclet.getLineTags().get(0);
    assertEquals("stubLineTagTitle", lineTag.getTitle().getTitle());
}
Also used : LineTag(org.eclipse.n4js.jsdoc.dom.LineTag) AbstractLineTagDefinition(org.eclipse.n4js.jsdoc.tags.AbstractLineTagDefinition) AbstractInlineTagDefinition(org.eclipse.n4js.jsdoc.tags.AbstractInlineTagDefinition) Doclet(org.eclipse.n4js.jsdoc.dom.Doclet) Test(org.junit.Test)

Example 12 with AbstractInlineTagDefinition

use of org.eclipse.n4js.jsdoc.tags.AbstractInlineTagDefinition in project n4js by eclipse.

the class DocletParserTest method testUnkonwLineTagIsIgnored.

@SuppressWarnings("javadoc")
@Test
public void testUnkonwLineTagIsIgnored() {
    String in = "/** \n * @unkonwTagTitle \n */";
    AbstractLineTagDefinition tag = new StubLineTagDefinition("stubLineTagTitle");
    DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tag)), new TagDictionary<AbstractInlineTagDefinition>());
    Doclet doclet = docletParser.parse(in);
    assertEquals(0, doclet.getLineTags().size());
}
Also used : AbstractLineTagDefinition(org.eclipse.n4js.jsdoc.tags.AbstractLineTagDefinition) AbstractInlineTagDefinition(org.eclipse.n4js.jsdoc.tags.AbstractInlineTagDefinition) Doclet(org.eclipse.n4js.jsdoc.dom.Doclet) Test(org.junit.Test)

Aggregations

AbstractInlineTagDefinition (org.eclipse.n4js.jsdoc.tags.AbstractInlineTagDefinition)12 Doclet (org.eclipse.n4js.jsdoc.dom.Doclet)11 Test (org.junit.Test)11 AbstractLineTagDefinition (org.eclipse.n4js.jsdoc.tags.AbstractLineTagDefinition)8 Text (org.eclipse.n4js.jsdoc.dom.Text)7 LineTag (org.eclipse.n4js.jsdoc.dom.LineTag)6 ContentNode (org.eclipse.n4js.jsdoc.dom.ContentNode)3 InlineTag (org.eclipse.n4js.jsdoc.dom.InlineTag)3 Composite (org.eclipse.n4js.jsdoc.dom.Composite)2 TagValue (org.eclipse.n4js.jsdoc.dom.TagValue)2 ScannerState (org.eclipse.n4js.jsdoc.JSDocCharScanner.ScannerState)1 TagTitle (org.eclipse.n4js.jsdoc.dom.TagTitle)1