use of com.intellij.util.FunctionUtil in project intellij-community by JetBrains.
the class TestsPattern method createSearchingForTestsTask.
@Override
public SearchForTestsTask createSearchingForTestsTask() {
final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
final Project project = getConfiguration().getProject();
final Set<String> classNames = new LinkedHashSet<>();
for (String className : data.getPatterns()) {
final PsiClass psiClass = getTestClass(project, className);
if (psiClass != null && JUnitUtil.isTestClass(psiClass)) {
classNames.add(className);
}
}
if (classNames.size() == data.getPatterns().size()) {
return new SearchForTestsTask(project, myServerSocket) {
@Override
protected void search() throws ExecutionException {
final Function<String, String> nameFunction = StringUtil.isEmpty(data.METHOD_NAME) ? FunctionUtil.<String>id() : (Function<String, String>) className -> className;
addClassesListToJavaParameters(classNames, nameFunction, "", false, getJavaParameters());
}
@Override
protected void onFound() {
}
};
}
return super.createSearchingForTestsTask();
}
Aggregations