use of spoon.test.generics.ComparableComparatorBug in project spoon by INRIA.
the class JavaReflectionTreeBuilderTest method testScannerGenericsInClass.
@Test
public void testScannerGenericsInClass() throws Exception {
final CtType<ComparableComparatorBug> aType = new JavaReflectionTreeBuilder(createFactory()).scan(ComparableComparatorBug.class);
assertNotNull(aType);
// New type parameter declaration.
assertEquals(1, aType.getFormalCtTypeParameters().size());
CtTypeParameter ctTypeParameter = aType.getFormalCtTypeParameters().get(0);
assertEquals("E extends java.lang.Comparable<? super E>", ctTypeParameter.toString());
assertEquals(1, ctTypeParameter.getSuperclass().getActualTypeArguments().size());
assertTrue(ctTypeParameter.getSuperclass().getActualTypeArguments().get(0) instanceof CtTypeParameterReference);
assertEquals("? super E", ctTypeParameter.getSuperclass().getActualTypeArguments().get(0).toString());
}
Aggregations