mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix type, delete unused class
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright 2003-2005 Dave Griffith
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.siyeh.ig.junit;
|
||||
|
||||
import com.intellij.psi.JavaRecursiveElementVisitor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiMethodCallExpression;
|
||||
import com.intellij.psi.PsiReferenceExpression;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
class ContainsAssertionVisitor extends JavaRecursiveElementVisitor {
|
||||
private boolean containsAssertion = false;
|
||||
|
||||
@Override public void visitElement(@NotNull PsiElement element) {
|
||||
if (!containsAssertion) {
|
||||
super.visitElement(element);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void visitMethodCallExpression(
|
||||
@NotNull PsiMethodCallExpression call) {
|
||||
if (containsAssertion) {
|
||||
return;
|
||||
}
|
||||
super.visitMethodCallExpression(call);
|
||||
final PsiReferenceExpression methodExpression =
|
||||
call.getMethodExpression();
|
||||
@NonNls final String methodName = methodExpression.getReferenceName();
|
||||
if (methodName == null) {
|
||||
return;
|
||||
}
|
||||
if (methodName.startsWith("assert") || methodName.startsWith("fail")) {
|
||||
containsAssertion = true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containsAssertion() {
|
||||
return containsAssertion;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<font face="verdana" size="-1">
|
||||
This inspection reports any test methods of JUnit test case classes which do not contain
|
||||
any assertions. Such methods indicate either incomplete or weak test cases. The table
|
||||
below can be used to specify which classname, method name regular expression combinations
|
||||
below can be used to specify which class name, method name regular expression combinations
|
||||
qualify as assertions.
|
||||
</font></td> </tr> <tr> <td height="20"> <font face="verdana" size="-2">Powered by InspectionGadgets </font> </td> </tr> </table> </body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user