use of com.redhat.qute.commons.InvalidMethodReason in project quarkus-ls by redhat-developer.
the class TemplateGetResolvedJavaTypeTest method string.
@Test
public void string() throws Exception {
loadMavenProject(QuteMavenProjectName.qute_quickstart);
QuteResolvedJavaTypeParams params = new QuteResolvedJavaTypeParams("java.lang.String", QuteMavenProjectName.qute_quickstart);
ResolvedJavaTypeInfo result = QuteSupportForTemplate.getInstance().getResolvedJavaType(params, getJDTUtils(), new NullProgressMonitor());
Assert.assertNotNull(result);
Assert.assertEquals("java.lang.String", result.getSignature());
Assert.assertFalse(result.isIterable());
Assert.assertNotNull(result.getMethods());
// Valid method isEmpty()
JavaMethodInfo isEmptyMethod = findMethod(result, "isEmpty");
Assert.assertNotNull(isEmptyMethod);
// Invalid method void getChars(int srcBegin, int srcEnd, char dst[], int
// dstBegin) {
JavaMethodInfo getCharsMethod = findMethod(result, "getChars");
Assert.assertNull(getCharsMethod);
InvalidMethodReason reason = result.getInvalidMethodReason("getChars");
Assert.assertEquals(InvalidMethodReason.VoidReturn, reason);
// Extended types
// public final class String implements java.io.Serializable,
// Comparable<String>, CharSequence {
List<String> extendedTypes = result.getExtendedTypes();
Assert.assertNotNull(extendedTypes);
assertExtendedTypes("java.lang.String", "java.io.Serializable", extendedTypes);
assertExtendedTypes("java.lang.String", "java.lang.CharSequence", extendedTypes);
}
Aggregations