Search in sources :

Example 1 with Comment1

use of spoon.test.comment.testclasses.Comment1 in project spoon by INRIA.

the class CommentTest method testCommentsInComment1And2.

@Test
public void testCommentsInComment1And2() {
    Factory f = getSpoonFactory();
    CtClass<?> type = (CtClass<?>) f.Type().get(Comment1.class);
    List<CtComment> comments = type.getElements(new TypeFilter<CtComment>(CtComment.class));
    assertEquals(4, comments.size());
    type = (CtClass<?>) f.Type().get(Comment2.class);
    comments = type.getElements(new TypeFilter<CtComment>(CtComment.class));
    assertEquals(2, comments.size());
    CtComment commentD = comments.get(1);
    assertEquals("D", commentD.getContent());
}
Also used : Comment1(spoon.test.comment.testclasses.Comment1) CtClass(spoon.reflect.declaration.CtClass) CtComment(spoon.reflect.code.CtComment) DefaultCoreFactory(spoon.support.DefaultCoreFactory) Factory(spoon.reflect.factory.Factory) TypeFilter(spoon.reflect.visitor.filter.TypeFilter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CtComment (spoon.reflect.code.CtComment)1 CtClass (spoon.reflect.declaration.CtClass)1 Factory (spoon.reflect.factory.Factory)1 TypeFilter (spoon.reflect.visitor.filter.TypeFilter)1 DefaultCoreFactory (spoon.support.DefaultCoreFactory)1 Comment1 (spoon.test.comment.testclasses.Comment1)1