fix type, delete unused class

This commit is contained in:
Bas Leijdekkers
2010-07-19 08:55:49 +02:00
parent 5de2a594bb
commit 4cb08bc809
2 changed files with 1 additions and 55 deletions
@@ -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;
}
}
@@ -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>