JavaFilesCache extends BaseTreeVisitor implements JavaFileScanner { public Set<String> getClassNames() { return classNames; }  Set<String> getClassNames(); @Override void scanFile(JavaFileScannerContext context); @Override void visitClass(ClassTree tree); @Override void visitMethod(MethodTree tree);  }
@Test void resource_file_mapping() { JavaFilesCache javaFilesCache = new JavaFilesCache(); JavaAstScanner.scanSingleFileForTests(TestUtils.inputFile("src/test/resources/JavaFilesCacheTestFile.java"), new VisitorsBridge(javaFilesCache)); Set<String> classNames = javaFilesCache.getClassNames(); assertThat(classNames) .hasSize(8) .contains( "org/sonar/java/JavaFilesCacheTestFile", "org/sonar/java/JavaFilesCacheTestFile$A", "org/sonar/java/JavaFilesCacheTestFile$plop", "org/sonar/java/JavaFilesCacheTestFile$A$I", "org/sonar/java/JavaFilesCacheTestFile$A$1B", "org/sonar/java/JavaFilesCacheTestFile$A$1B$1", "org/sonar/java/JavaFilesCacheTestFile$A$2", "org/sonar/java/JavaFilesCacheTestFile$A$3"); }