private MySearchForTestsTask findTestsWithProgress( final FindCallback callback, final TestClassFilter classFilter) { if (isSyncSearch()) { THashSet<PsiClass> classes = new THashSet<PsiClass>(); boolean isJUnit4 = ConfigurationUtil.findAllTestClasses(classFilter, classes); callback.found(classes, isJUnit4); return null; } final THashSet<PsiClass> classes = new THashSet<PsiClass>(); final boolean[] isJunit4 = new boolean[1]; final MySearchForTestsTask task = new MySearchForTestsTask(classFilter, isJunit4, classes, callback); mySearchForTestsIndicator = new BackgroundableProcessIndicator(task); ProgressManager.getInstance() .runProcessWithProgressAsynchronously(task, mySearchForTestsIndicator); return task; }
@Override public void onSuccess() { myCallback.found(myClasses, myJunit4[0]); finish(); }