find tests in package: abstract tests are in diffeternt package and impls do not...
authorAnna Kozlova <Anna.Kozlova@jetbrains.com>
Thu, 17 Sep 2009 10:13:27 +0000 (14:13 +0400)
committerAnna Kozlova <Anna.Kozlova@jetbrains.com>
Thu, 17 Sep 2009 10:13:27 +0000 (14:13 +0400)
plugins/junit/src/com/intellij/execution/ConfigurationUtil.java

index 1b7705776ba5240b7d04917350df75c8d6e239ed..85174bc01dee4a45f00873eebe5803ca7068c68e 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.psi.search.PsiElementProcessor;
 import com.intellij.psi.search.PsiElementProcessorAdapter;
 import com.intellij.psi.search.searches.AnnotatedMembersSearch;
 import com.intellij.psi.search.searches.ClassInheritorsSearch;
+import com.intellij.psi.util.PsiUtilBase;
 import com.intellij.util.Processor;
 import junit.runner.BaseTestRunner;
 import org.jetbrains.annotations.Nullable;
@@ -92,11 +93,11 @@ public class ConfigurationUtil {
     if (testAnnotation != null) {
      ApplicationManager.getApplication().runReadAction(new Runnable() {
          public void run(){
-              AnnotatedMembersSearch.search(testAnnotation, scope).forEach(new Processor<PsiMember>() {
+              AnnotatedMembersSearch.search(testAnnotation, GlobalSearchScope.allScope(manager.getProject())).forEach(new Processor<PsiMember>() {
              public boolean process(final PsiMember annotated) {
                PsiClass containingClass = annotated instanceof PsiClass ? (PsiClass)annotated : annotated.getContainingClass();
                if (containingClass != null && annotated instanceof PsiMethod == isMethod) {
-                 if (testClassFilter.isAccepted(containingClass)) {
+                 if (scope.contains(PsiUtilBase.getVirtualFile(containingClass)) && testClassFilter.isAccepted(containingClass)) {
                    found.add(containingClass);
                    isJUnit4.set(Boolean.TRUE);
                  }