@Test public void noProject() { final org.uberfire.java.nio.file.Path root = fileSystemProvider.getPath(URI.create("default: final Path path = Paths.convert(root); doThrow(new IllegalArgumentException()).when(projectService).resolveProject(path); final Set<String> result = scoreCardServiceLoader.find(path, "org.test"); verify(refactoringQueryService, never()).query(eq(FindScorecardNamesQuery.NAME), any()); assertEquals(0, result.size()); }
public Set<String> find(final Path path, final String packageName) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindScorecardNamesQuery.NAME, new HashSet<ValueIndexTerm>() {{ add(new ValueSharedPartIndexTerm( "*", PartType.SCORECARD_MODEL_NAME, ValueIndexTerm.TermSearchType.WILDCARD)); add(new ValueModuleRootPathIndexTerm( workspaceProject.getMainModule().getRootPath().toURI())); add(new ValuePackageNameIndexTerm( packageName)); }}); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } finally { return result; } }
ScoreCardServiceLoaderImpl implements ScoreCardServiceLoader { public Set<String> find(final Path path, final String packageName) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindScorecardNamesQuery.NAME, new HashSet<ValueIndexTerm>() {{ add(new ValueSharedPartIndexTerm( "*", PartType.SCORECARD_MODEL_NAME, ValueIndexTerm.TermSearchType.WILDCARD)); add(new ValueModuleRootPathIndexTerm( workspaceProject.getMainModule().getRootPath().toURI())); add(new ValuePackageNameIndexTerm( packageName)); }}); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } finally { return result; } } }
ScoreCardServiceLoaderImpl implements ScoreCardServiceLoader { public Set<String> find(final Path path, final String packageName) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindScorecardNamesQuery.NAME, new HashSet<ValueIndexTerm>() {{ add(new ValueSharedPartIndexTerm( "*", PartType.SCORECARD_MODEL_NAME, ValueIndexTerm.TermSearchType.WILDCARD)); add(new ValueModuleRootPathIndexTerm( workspaceProject.getMainModule().getRootPath().toURI())); add(new ValuePackageNameIndexTerm( packageName)); }}); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } finally { return result; } }  }
ScoreCardServiceLoaderImpl implements ScoreCardServiceLoader { public Set<String> find(final Path path, final String packageName) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindScorecardNamesQuery.NAME, new HashSet<ValueIndexTerm>() {{ add(new ValueSharedPartIndexTerm( "*", PartType.SCORECARD_MODEL_NAME, ValueIndexTerm.TermSearchType.WILDCARD)); add(new ValueModuleRootPathIndexTerm( workspaceProject.getMainModule().getRootPath().toURI())); add(new ValuePackageNameIndexTerm( packageName)); }}); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } finally { return result; } }  Set<String> find(final Path path,
                            final String packageName); }
ScoreCardServiceLoaderImpl implements ScoreCardServiceLoader { public Set<String> find(final Path path, final String packageName) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindScorecardNamesQuery.NAME, new HashSet<ValueIndexTerm>() {{ add(new ValueSharedPartIndexTerm( "*", PartType.SCORECARD_MODEL_NAME, ValueIndexTerm.TermSearchType.WILDCARD)); add(new ValueModuleRootPathIndexTerm( workspaceProject.getMainModule().getRootPath().toURI())); add(new ValuePackageNameIndexTerm( packageName)); }}); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } finally { return result; } }  Set<String> find(final Path path,
                            final String packageName);  }