use of org.springframework.ide.vscode.commons.java.IMethod in project sts4 by spring-projects.
the class HtmlJavadocTest method html_testInnerClassJavadocForOutputFolder.
@Test
public void html_testInnerClassJavadocForOutputFolder() throws Exception {
MavenJavaProject project = projectSupplier.get();
IType type = project.getClasspath().findType("hello.Greeting$TestInnerClass");
assertNotNull(type);
IJavadoc javaDoc = type.getJavaDoc();
assertNotNull(javaDoc);
assertEquals("<div class=\"block\">Comment for inner class</div>", javaDoc.getRenderable().toHtml());
IField field = type.getField("innerField");
assertNotNull(field);
String expected = String.join("\n", "<h4>innerField</h4>", "<pre>protected int innerField</pre>", "<div class=\"block\">Comment for inner field</div>");
javaDoc = field.getJavaDoc();
assertNotNull(javaDoc);
assertEquals(expected, javaDoc.getRenderable().toHtml());
IMethod method = type.getMethod("getInnerField", Stream.empty());
assertNotNull(method);
expected = String.join("\n", "<h4>getInnerField</h4>", "<pre>public int getInnerField()</pre>", "<div class=\"block\">Comment for method inside nested class</div>");
javaDoc = method.getJavaDoc();
assertNotNull(javaDoc);
assertEquals(expected, javaDoc.getRenderable().toHtml());
}
use of org.springframework.ide.vscode.commons.java.IMethod in project sts4 by spring-projects.
the class JavaIndexTest method voidMethodNoParams.
@Test
public void voidMethodNoParams() throws Exception {
MavenJavaProject project = mavenProjectsCache.get("gs-rest-service-cors-boot-1.4.1-with-classpath-file");
IType type = project.getClasspath().findType("java.util.ArrayList");
assertNotNull(type);
IMethod m = type.getMethod("clear", Stream.empty());
assertEquals("clear", m.getElementName());
assertEquals(IVoidType.DEFAULT, m.getReturnType());
assertEquals(0, m.parameters().count());
}
Aggregations