mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make 'ignored test' inspection ready for junit 5
This commit is contained in:
+1
-1
@@ -1912,7 +1912,7 @@ use.of.obsolete.assert.problem.descriptor=Call to <code>#ref()</code> from ''{0}
|
||||
use.of.obsolete.assert.quickfix=Replace with 'org.junit.Assert' method call
|
||||
properties.object.as.hashtable.set.quickfix=Replace with call to 'setProperty()'
|
||||
properties.object.as.hashtable.get.quickfix=Replace with call to 'getProperty()'
|
||||
ignored.junit.test.display.name=JUnit test annotated with '@Ignore'
|
||||
ignored.junit.test.display.name=JUnit test annotated with '@Ignore'/'@Disabled'
|
||||
ignored.junit.test.classproblem.descriptor=Test class ''{0}'' annotated with <code>#ref</code> #loc
|
||||
ignored.junit.test.method.problem.descriptor=Test method ''{0}()'' annotated with <code>#ref</code> #loc
|
||||
unclear.binary.expression.display.name=Unclear expression
|
||||
|
||||
+3
-6
@@ -59,15 +59,12 @@ public class IgnoredJUnitTestInspection extends BaseInspection {
|
||||
@Override
|
||||
public void visitAnnotation(PsiAnnotation annotation) {
|
||||
super.visitAnnotation(annotation);
|
||||
final PsiModifierListOwner modifierListOwner =
|
||||
PsiTreeUtil.getParentOfType(annotation,
|
||||
PsiModifierListOwner.class);
|
||||
final PsiModifierListOwner modifierListOwner = PsiTreeUtil.getParentOfType(annotation, PsiModifierListOwner.class);
|
||||
if (!(modifierListOwner instanceof PsiClass ||
|
||||
modifierListOwner instanceof PsiMethod)) {
|
||||
return;
|
||||
}
|
||||
final PsiJavaCodeReferenceElement nameReferenceElement =
|
||||
annotation.getNameReferenceElement();
|
||||
final PsiJavaCodeReferenceElement nameReferenceElement = annotation.getNameReferenceElement();
|
||||
if (nameReferenceElement == null) {
|
||||
return;
|
||||
}
|
||||
@@ -77,7 +74,7 @@ public class IgnoredJUnitTestInspection extends BaseInspection {
|
||||
}
|
||||
final PsiClass aClass = (PsiClass)target;
|
||||
@NonNls final String qualifiedName = aClass.getQualifiedName();
|
||||
if (!"org.junit.Ignore".equals(qualifiedName)) {
|
||||
if (!"org.junit.Ignore".equals(qualifiedName) && !"org.junit.jupiter.api.Disabled".equals(qualifiedName)) {
|
||||
return;
|
||||
}
|
||||
registerError(annotation, modifierListOwner);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<html>
|
||||
<body>
|
||||
Reports JUnit tests which are annotated with @Ignore.
|
||||
Reports JUnit tests which are annotated with @Ignore/@Disabled.
|
||||
<!-- tooltip end -->
|
||||
<p>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user