use of org.eclipse.n4js.jsdoc.DocletParser in project n4js by eclipse.
the class SimpleN4JSDocTest method testWhitespaces_IDEBUG_571_b.
@SuppressWarnings("javadoc")
@Test
public void testWhitespaces_IDEBUG_571_b() {
String in = "/**\n" + " * X\n" + " * \n" + " * @testeeType Y\n" + " */";
DocletParser docletParser = new N4JSDocletParser();
Doclet doclet = docletParser.parse(in);
String descr = ((Text) doclet.getContents().get(0)).getText();
assertEquals("X", descr);
assertSameNumberOfLineTags(1, doclet);
}
use of org.eclipse.n4js.jsdoc.DocletParser in project n4js by eclipse.
the class SimpleN4JSDocTest method testWhitespaces_IDEBUG_571_a.
@SuppressWarnings("javadoc")
@Test
public void testWhitespaces_IDEBUG_571_a() {
String in = "/**\n" + " * X\n" + " *\n" + " * @testeeType Y" + " */";
DocletParser docletParser = new N4JSDocletParser();
Doclet doclet = docletParser.parse(in);
String descr = ((Text) doclet.getContents().get(0)).getText();
assertEquals("X", descr);
assertSameNumberOfLineTags(1, doclet);
}
use of org.eclipse.n4js.jsdoc.DocletParser in project n4js by eclipse.
the class InlineTagTest method testSimpleLineTag.
@SuppressWarnings("javadoc")
@Test
public void testSimpleLineTag() {
String in = "/** Some Description {@inline me} some other text. \n */";
AbstractInlineTagDefinition tag = new StubInlineTagDefinition("inline");
DocletParser docletParser = new DocletParser(new TagDictionary<AbstractLineTagDefinition>(), new TagDictionary<>(Arrays.asList(tag)));
Doclet doclet = docletParser.parse(in);
EList<ContentNode> contents = doclet.getContents();
Composite composite = (Composite) contents.get(0);
ContentNode node0 = composite.getContents().get(0);
ContentNode node1 = composite.getContents().get(1);
ContentNode node2 = composite.getContents().get(2);
Text descriptionText1 = (Text) node0;
InlineTag descriptionInlineTag = (InlineTag) node1;
Text descriptionText2 = (Text) node2;
assertEquals("Some Description ", descriptionText1.getText());
assertEquals(" some other text.", descriptionText2.getText());
TagValue inlineDescription = descriptionInlineTag.getValueByKey(StubInlineTagDefinition.PARAM_VALUE);
Text tValue = (Text) inlineDescription.getContents().get(0);
assertEquals(" me", tValue.getText());
}
use of org.eclipse.n4js.jsdoc.DocletParser in project n4js by eclipse.
the class LineTagWithFullMemberReferenceTest method test_fullRef_symbolName.
@SuppressWarnings("javadoc")
@Test
public void test_fullRef_symbolName() {
String in = "/** foo." + "\n * @testee n4/model/collections/DataSet.DataSet.#iterator" + "\n */";
AbstractLineTagDefinition tagDef = new LineTagWithFullMemberReference("testee");
DocletParser docletParser = new DocletParser(new TagDictionary<>(Arrays.asList(tagDef)), new TagDictionary<AbstractInlineTagDefinition>());
Doclet doclet = docletParser.parse(in);
LineTag lineTag = doclet.getLineTags().get(0);
EList<ContentNode> contents = lineTag.getValueByKey(LineTagWithFullElementReference.REF).getContents();
FullMemberReference ref = (FullMemberReference) contents.get(0);
assertEquals("n4/model/collections/DataSet", ref.getModuleName());
assertEquals("DataSet", ref.getTypeName());
assertEquals("#iterator", ref.getMemberName());
}
use of org.eclipse.n4js.jsdoc.DocletParser in project n4js by eclipse.
the class SimpleN4JSDocTest method assertSameNumberOfLineTags.
private void assertSameNumberOfLineTags(int expectedNumberOfTags, String jsdocString) {
DocletParser docletParser = new N4JSDocletParser();
Doclet doclet = docletParser.parse(jsdocString);
assertEquals("Line tag number differs", expectedNumberOfTags, doclet.getLineTags().size());
}
Aggregations