Search in sources :

Example 1 with ReturnOrThrowFilter

use of spoon.reflect.visitor.filter.ReturnOrThrowFilter in project spoon by INRIA.

the class FilterTest method testReturnOrThrowFilter.

@Test
public void testReturnOrThrowFilter() throws Exception {
    CtClass<?> foo = factory.Package().get("spoon.test.filters").getType("Foo");
    assertEquals("Foo", foo.getSimpleName());
    List<CtCFlowBreak> expressions = foo.getElements(new ReturnOrThrowFilter());
    assertEquals(2, expressions.size());
}
Also used : CtCFlowBreak(spoon.reflect.code.CtCFlowBreak) ReturnOrThrowFilter(spoon.reflect.visitor.filter.ReturnOrThrowFilter) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 CtCFlowBreak (spoon.reflect.code.CtCFlowBreak)1 ReturnOrThrowFilter (spoon.reflect.visitor.filter.ReturnOrThrowFilter)1