mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-202179 fixed wrong test runner for abstract method tests
This commit is contained in:
committed by
Sergei Vorobyov
parent
a7c4f869f3
commit
d952220a2d
@@ -38,6 +38,10 @@ public abstract class TestFrameworks {
|
||||
|
||||
public abstract boolean isTestMethod(PsiMethod method);
|
||||
|
||||
public boolean isTestMethod(PsiMethod method, boolean checkAbstract) {
|
||||
return isTestMethod(method);
|
||||
}
|
||||
|
||||
public boolean isTestOrConfig(PsiClass psiClass) {
|
||||
return isTestClass(psiClass) || hasConfigMethods(psiClass);
|
||||
}
|
||||
|
||||
@@ -94,4 +94,12 @@ public class TestFrameworksImpl extends TestFrameworks {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTestMethod(PsiMethod method, boolean checkAbstract) {
|
||||
for (TestFramework framework : TestFramework.EXTENSION_NAME.getExtensionList()) {
|
||||
if (framework.isTestMethod(method, checkAbstract)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class GradleRunnerUtil {
|
||||
public static Location<PsiMethod> getTestMethod(final Location<?> location) {
|
||||
for (Iterator<Location<PsiMethod>> iterator = location.getAncestors(PsiMethod.class, false); iterator.hasNext(); ) {
|
||||
final Location<PsiMethod> methodLocation = iterator.next();
|
||||
if (TestFrameworks.getInstance().isTestMethod(methodLocation.getPsiElement())) return methodLocation;
|
||||
if (TestFrameworks.getInstance().isTestMethod(methodLocation.getPsiElement(), false)) return methodLocation;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user