mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
junit 5: for mixed junit 3 & 5 check inheritance if no annotations found (IDEA-162923)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -35,7 +35,6 @@ import com.intellij.psi.util.PsiClassUtil;
|
||||
import com.intellij.ui.ColoredListCellRenderer;
|
||||
import com.intellij.ui.components.JBList;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Processor;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.ArrayList;
|
||||
@@ -85,7 +84,7 @@ public class InheritorChooser {
|
||||
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> {
|
||||
final boolean isJUnit5 = ApplicationManager.getApplication().runReadAction((Computable<Boolean>)() -> JUnitUtil.isJUnit5(containingClass));
|
||||
ClassInheritorsSearch.search(containingClass).forEach(aClass -> {
|
||||
if (PsiClassUtil.isRunnableClass(aClass, !isJUnit5, true)) {
|
||||
if (isJUnit5 && JUnitUtil.isJUnit5TestClass(aClass, true) || PsiClassUtil.isRunnableClass(aClass, true, true)) {
|
||||
classes.add(aClass);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -138,8 +138,8 @@ public class JUnitUtil {
|
||||
|
||||
public static boolean isTestClass(@NotNull PsiClass psiClass, boolean checkAbstract, boolean checkForTestCaseInheritance) {
|
||||
if (psiClass.getQualifiedName() == null) return false;
|
||||
if (isJUnit5(psiClass)) {
|
||||
return isJUnit5TestClass(psiClass, checkAbstract);
|
||||
if (isJUnit5(psiClass) && isJUnit5TestClass(psiClass, checkAbstract)) {
|
||||
return true;
|
||||
}
|
||||
final PsiClass topLevelClass = PsiTreeUtil.getTopmostParentOfType(psiClass, PsiClass.class);
|
||||
if (topLevelClass != null) {
|
||||
|
||||
Reference in New Issue
Block a user