run abstract tests: ask about target class each time [peter] idea/112.603
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 26 Jan 2012 15:22:17 +0000 (19:22 +0400)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 26 Jan 2012 15:25:48 +0000 (19:25 +0400)
plugins/junit/src/com/intellij/execution/junit/TestMethod.java
plugins/junit/src/com/intellij/execution/junit/TestsPattern.java

index ab93fa1232b9e6fc94122fad3900422cbd1c2489..e84c0ff0bc7a04b14366441aa8f7541b6162ffe1 100644 (file)
@@ -21,7 +21,10 @@ import com.intellij.execution.*;
 import com.intellij.execution.configurations.*;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Comparing;
-import com.intellij.psi.*;
+import com.intellij.psi.PsiClass;
+import com.intellij.psi.PsiElement;
+import com.intellij.psi.PsiMethod;
+import com.intellij.psi.PsiPackage;
 import com.intellij.psi.search.GlobalSearchScope;
 import com.intellij.refactoring.listeners.RefactoringElementAdapter;
 import com.intellij.refactoring.listeners.RefactoringElementListener;
@@ -106,12 +109,14 @@ class TestMethod extends TestObject {
                                        PsiMethod testMethod,
                                        PsiPackage testPackage) {
     if (testMethod == null) return false;
-    final PsiClass containingClass = testMethod.getContainingClass();
-    if (testClass == null && (containingClass == null || !containingClass.hasModifierProperty(PsiModifier.ABSTRACT))) return false;
+    if (testClass == null) return false;
     final JUnitConfiguration.Data data = configuration.getPersistentData();
+    /*final PsiClass containingClass = testMethod.getContainingClass();
+    if (testClass == null && (containingClass == null || !containingClass.hasModifierProperty(PsiModifier.ABSTRACT))) return false;
+
     if (containingClass != null && containingClass.hasModifierProperty(PsiModifier.ABSTRACT)) {
       return Comparing.equal(testMethod.getName(), data.getMethodName());
-    }
+    }*/
     return
       Comparing.equal(JavaExecutionUtil.getRuntimeQualifiedName(testClass), data.getMainClassName()) &&
       Comparing.equal(testMethod.getName(), data.getMethodName());
index df090c198bf0db440e0c1e4e93e85eafee7827d8..01527b71fde390a6a440c44ddacbae51b09333fd 100644 (file)
@@ -27,7 +27,6 @@ import com.intellij.execution.util.JavaParametersUtil;
 import com.intellij.openapi.module.Module;
 import com.intellij.openapi.module.ModuleUtil;
 import com.intellij.openapi.project.Project;
-import com.intellij.openapi.util.Comparing;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.PsiClass;
 import com.intellij.psi.PsiElement;
@@ -108,9 +107,9 @@ public class TestsPattern extends TestObject {
                                        PsiClass testClass,
                                        PsiMethod testMethod,
                                        PsiPackage testPackage) {
-    if (testMethod != null && Comparing.strEqual(testMethod.getName(), configuration.getPersistentData().METHOD_NAME)) {
+    /*if (testMethod != null && Comparing.strEqual(testMethod.getName(), configuration.getPersistentData().METHOD_NAME)) {
       return true;
-    }
+    }*/
     return false;
   }