use of org.eclipse.xtext.common.types.JvmArrayType in project xtext-eclipse by eclipse.
the class AbstractTypeProviderTest method test_arrayWildcard_02.
@Test
public void test_arrayWildcard_02() {
JvmOperation arrayWildcard = getMethodFromParameterizedMethods("arrayWildcard(java.util.List[])");
JvmTypeReference paramType = arrayWildcard.getParameters().get(0).getParameterType();
assertEquals("java.util.List<? extends java.lang.Object>[]", paramType.getIdentifier());
assertTrue(paramType.getType() instanceof JvmArrayType);
JvmArrayType arrayType = (JvmArrayType) paramType.getType();
assertTrue(arrayType.getComponentType() instanceof JvmDeclaredType);
assertTrue(paramType instanceof JvmGenericArrayTypeReference);
assertTrue(((JvmGenericArrayTypeReference) paramType).getComponentType() instanceof JvmParameterizedTypeReference);
}
use of org.eclipse.xtext.common.types.JvmArrayType in project xtext-eclipse by eclipse.
the class AbstractTypeProviderTest method test_nestedArrayVariable_02.
@Test
public void test_nestedArrayVariable_02() {
JvmOperation nestedArrayVariable = getMethodFromParameterizedMethods("nestedArrayVariable(T[][])");
JvmType paramType = nestedArrayVariable.getParameters().get(0).getParameterType().getType();
assertTrue(paramType instanceof JvmArrayType);
JvmArrayType arrayType = (JvmArrayType) paramType;
assertTrue(arrayType.getComponentType() instanceof JvmArrayType);
arrayType = (JvmArrayType) arrayType.getComponentType();
assertTrue(arrayType.getComponentType() instanceof JvmTypeParameter);
}
use of org.eclipse.xtext.common.types.JvmArrayType in project xtext-eclipse by eclipse.
the class AbstractTypeProviderTest method test_arrayVariable_02.
@Test
public void test_arrayVariable_02() {
JvmOperation arrayVariable = getMethodFromParameterizedMethods("arrayVariable(T[])");
JvmType paramType = arrayVariable.getParameters().get(0).getParameterType().getType();
assertEquals("T[]", paramType.getIdentifier());
assertTrue(paramType instanceof JvmArrayType);
JvmArrayType arrayType = (JvmArrayType) paramType;
assertTrue(arrayType.getComponentType() instanceof JvmTypeParameter);
}
Aggregations