make 'ignored test' inspection ready for junit 5

This commit is contained in:
Anna.Kozlova
2016-10-19 16:46:49 +02:00
parent cb08eabbc0
commit a4fb99cb2e
3 changed files with 5 additions and 8 deletions
@@ -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
@@ -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>