more interruptibility
authorAlexey Kudravtsev <cdr@intellij.com>
Tue, 3 Aug 2010 11:33:40 +0000 (15:33 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Tue, 3 Aug 2010 15:05:15 +0000 (19:05 +0400)
java/execution/impl/src/com/intellij/execution/junit/JUnitUtil.java

index 704938e4555b7217750314ed8c25591ed7ada904..1ea21942f526d6bb3ecc2ba8950f2acf27e11353 100644 (file)
@@ -21,6 +21,7 @@ import com.intellij.execution.junit2.info.MethodLocation;
 import com.intellij.execution.testframework.SourceScope;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleUtil;
+import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Condition;
 import com.intellij.psi.*;
@@ -109,6 +110,7 @@ public class JUnitUtil {
     if (AnnotationUtil.isAnnotated(psiClass, RUN_WITH, true)) return true;
 
     for (final PsiMethod method : psiClass.getAllMethods()) {
+      ProgressManager.checkCanceled();
       if (isSuiteMethod(method)) return true;
       if (isTestAnnotated(method)) return true;
     }
@@ -131,6 +133,7 @@ public class JUnitUtil {
     if (modifierList == null) return false;
     if (AnnotationUtil.isAnnotated(psiClass, RUN_WITH, true)) return true;
     for (final PsiMethod method : psiClass.getAllMethods()) {
+      ProgressManager.checkCanceled();
       if (isTestAnnotated(method)) return true;
     }