Search in sources :

Example 6 with JvmInnerTypeReference

use of org.eclipse.xtext.common.types.JvmInnerTypeReference in project xtext-eclipse by eclipse.

the class AbstractTypeProviderTest method test_ParameterizedTypes_inner_param_01.

@Test
public void test_ParameterizedTypes_inner_param_01() {
    String typeName = ParameterizedTypes.class.getName();
    JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
    JvmOperation operation = getMethodFromType(type, ParameterizedTypes.class, "plainInner(org.eclipse.xtext.common.types.testSetups.ParameterizedTypes$Inner)");
    JvmTypeReference parameterType = operation.getParameters().get(0).getParameterType();
    assertTrue(parameterType.getIdentifier(), parameterType instanceof JvmInnerTypeReference);
    assertEquals("ParameterizedTypes<S, T, U, V, W>$Inner<W, List<W>, List<W>>", parameterType.getSimpleName());
}
Also used : JvmOperation(org.eclipse.xtext.common.types.JvmOperation) JvmInnerTypeReference(org.eclipse.xtext.common.types.JvmInnerTypeReference) JvmTypeReference(org.eclipse.xtext.common.types.JvmTypeReference) JvmGenericType(org.eclipse.xtext.common.types.JvmGenericType) Test(org.junit.Test)

Example 7 with JvmInnerTypeReference

use of org.eclipse.xtext.common.types.JvmInnerTypeReference in project xtext-eclipse by eclipse.

the class AbstractTypeProviderTest method test_ParameterizedTypes_inner_return_02.

@Test
public void test_ParameterizedTypes_inner_return_02() {
    String typeName = ParameterizedTypes.class.getName();
    JvmGenericType type = (JvmGenericType) getTypeProvider().findTypeByName(typeName);
    JvmOperation operation = getMethodFromType(type, ParameterizedTypes.class, "concreteInner()");
    JvmTypeReference returnType = operation.getReturnType();
    assertTrue(returnType.getIdentifier(), returnType instanceof JvmInnerTypeReference);
    assertEquals("ParameterizedTypes<String, String, List<String>, V, String>$Inner<String, List<String>, List<String>>", returnType.getSimpleName());
}
Also used : JvmOperation(org.eclipse.xtext.common.types.JvmOperation) JvmInnerTypeReference(org.eclipse.xtext.common.types.JvmInnerTypeReference) JvmTypeReference(org.eclipse.xtext.common.types.JvmTypeReference) JvmGenericType(org.eclipse.xtext.common.types.JvmGenericType) Test(org.junit.Test)

Aggregations

JvmInnerTypeReference (org.eclipse.xtext.common.types.JvmInnerTypeReference)7 JvmTypeReference (org.eclipse.xtext.common.types.JvmTypeReference)6 JvmGenericType (org.eclipse.xtext.common.types.JvmGenericType)5 JvmOperation (org.eclipse.xtext.common.types.JvmOperation)5 Test (org.junit.Test)5 JvmGenericArrayTypeReference (org.eclipse.xtext.common.types.JvmGenericArrayTypeReference)2 JvmParameterizedTypeReference (org.eclipse.xtext.common.types.JvmParameterizedTypeReference)2 EPackage (org.eclipse.emf.ecore.EPackage)1 InternalEList (org.eclipse.emf.ecore.util.InternalEList)1 ITypeBinding (org.eclipse.jdt.core.dom.ITypeBinding)1 RichString (org.eclipse.xtend.core.xtend.RichString)1 RichStringLiteral (org.eclipse.xtend.core.xtend.RichStringLiteral)1 XtendAnnotationType (org.eclipse.xtend.core.xtend.XtendAnnotationType)1 XtendClass (org.eclipse.xtend.core.xtend.XtendClass)1 XtendEnum (org.eclipse.xtend.core.xtend.XtendEnum)1 XtendField (org.eclipse.xtend.core.xtend.XtendField)1 XtendFormalParameter (org.eclipse.xtend.core.xtend.XtendFormalParameter)1 XtendInterface (org.eclipse.xtend.core.xtend.XtendInterface)1 XtendMember (org.eclipse.xtend.core.xtend.XtendMember)1 XtendParameter (org.eclipse.xtend.core.xtend.XtendParameter)1