Search in sources :

Example 1 with MemberUsageScanner

use of org.reflections.scanners.MemberUsageScanner in project flink by apache.

the class CheckForbiddenMethodsUsage method testNoDefaultEncoding.

@Test
public void testNoDefaultEncoding() throws Exception {
    final Reflections reflections = new Reflections(new ConfigurationBuilder().useParallelExecutor(Runtime.getRuntime().availableProcessors()).addUrls(ClasspathHelper.forPackage("org.apache.flink")).addScanners(new MemberUsageScanner()));
    for (ForbiddenCall forbiddenCall : forbiddenCalls) {
        final Set<Member> methodUsages = forbiddenCall.getUsages(reflections);
        methodUsages.removeAll(forbiddenCall.getExclusions());
        assertEquals("Unexpected calls: " + methodUsages, 0, methodUsages.size());
    }
}
Also used : ConfigurationBuilder(org.reflections.util.ConfigurationBuilder) MemberUsageScanner(org.reflections.scanners.MemberUsageScanner) Member(java.lang.reflect.Member) Reflections(org.reflections.Reflections) Test(org.junit.Test) FieldParserTest(org.apache.flink.types.parser.FieldParserTest)

Aggregations

Member (java.lang.reflect.Member)1 FieldParserTest (org.apache.flink.types.parser.FieldParserTest)1 Test (org.junit.Test)1 Reflections (org.reflections.Reflections)1 MemberUsageScanner (org.reflections.scanners.MemberUsageScanner)1 ConfigurationBuilder (org.reflections.util.ConfigurationBuilder)1