@Test public void test_processFiles__single_file() throws FileNotFoundException { String filePath = path + "test_pair.txt"; List<String> roots = new LinkedList<>(); roots.add(filePath); List<MarkerPair> pairs = getMarkers(); Map<String, List<MarkerPair>> result = new HashMap<>(); result.put(filePath, pairs); AnalyzerResult expectedAnalyzerResult = new AnalyzerResult(result); AnalyzerResult actualAnalyzerResult = processor.analyze(roots); assertThat(actualAnalyzerResult, is(expectedAnalyzerResult)); assertThat(actualAnalyzerResult.hasResults(), is(true)); }
public AnalyzerResult analyze(List<String> filePaths) throws FileNotFoundException { if (filePaths == null || filePaths.isEmpty()) { return null; } List<File> files = new LinkedList<>(); for (String filePath : filePaths) { File file = new File(filePath); if (file.exists()) { files.add(file); } else { throw new FileNotFoundException("File not found: " + filePath); } } Map<String, List<MarkerPair>> result = analyzeFiles(files); AnalyzerResult analyzerResult = new AnalyzerResult(result); return analyzerResult; }
Analyzer { public AnalyzerResult analyze(List<String> filePaths) throws FileNotFoundException { if (filePaths == null || filePaths.isEmpty()) { return null; } List<File> files = new LinkedList<>(); for (String filePath : filePaths) { File file = new File(filePath); if (file.exists()) { files.add(file); } else { throw new FileNotFoundException("File not found: " + filePath); } } Map<String, List<MarkerPair>> result = analyzeFiles(files); AnalyzerResult analyzerResult = new AnalyzerResult(result); return analyzerResult; } }
Analyzer { public AnalyzerResult analyze(List<String> filePaths) throws FileNotFoundException { if (filePaths == null || filePaths.isEmpty()) { return null; } List<File> files = new LinkedList<>(); for (String filePath : filePaths) { File file = new File(filePath); if (file.exists()) { files.add(file); } else { throw new FileNotFoundException("File not found: " + filePath); } } Map<String, List<MarkerPair>> result = analyzeFiles(files); AnalyzerResult analyzerResult = new AnalyzerResult(result); return analyzerResult; }  }
Analyzer { public AnalyzerResult analyze(List<String> filePaths) throws FileNotFoundException { if (filePaths == null || filePaths.isEmpty()) { return null; } List<File> files = new LinkedList<>(); for (String filePath : filePaths) { File file = new File(filePath); if (file.exists()) { files.add(file); } else { throw new FileNotFoundException("File not found: " + filePath); } } Map<String, List<MarkerPair>> result = analyzeFiles(files); AnalyzerResult analyzerResult = new AnalyzerResult(result); return analyzerResult; }  AnalyzerResult analyze(List<String> filePaths); }
Analyzer { public AnalyzerResult analyze(List<String> filePaths) throws FileNotFoundException { if (filePaths == null || filePaths.isEmpty()) { return null; } List<File> files = new LinkedList<>(); for (String filePath : filePaths) { File file = new File(filePath); if (file.exists()) { files.add(file); } else { throw new FileNotFoundException("File not found: " + filePath); } } Map<String, List<MarkerPair>> result = analyzeFiles(files); AnalyzerResult analyzerResult = new AnalyzerResult(result); return analyzerResult; }  AnalyzerResult analyze(List<String> filePaths);  }