mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
add setup method before first test method: setting needed? (IDEA-61605)
This commit is contained in:
@@ -31,6 +31,7 @@ import com.intellij.psi.util.TypeConversionUtil;
|
||||
import com.intellij.util.containers.Convertor;
|
||||
import junit.runner.BaseTestRunner;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.junit.After;
|
||||
import org.junit.AfterClass;
|
||||
import org.junit.Before;
|
||||
@@ -209,6 +210,18 @@ public class JUnitUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
protected static PsiMethod findFirstTestMethod(PsiClass clazz) {
|
||||
PsiMethod testMethod = null;
|
||||
for (PsiMethod method : clazz.getMethods()) {
|
||||
if (isTestMethod(MethodLocation.elementInClass(method, clazz)) || isSuiteMethod(method)) {
|
||||
testMethod = method;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return testMethod;
|
||||
}
|
||||
|
||||
public static class TestMethodFilter implements Condition<PsiMethod> {
|
||||
private final PsiClass myClass;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user