From 4cb08bc80968dfc840fbf7f4eb57a90576d9effd Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Mon, 19 Jul 2010 08:55:49 +0200 Subject: [PATCH] fix type, delete unused class --- .../ig/junit/ContainsAssertionVisitor.java | 54 ------------------- .../TestMethodWithoutAssertion.html | 2 +- 2 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 plugins/InspectionGadgets/src/com/siyeh/ig/junit/ContainsAssertionVisitor.java diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/junit/ContainsAssertionVisitor.java b/plugins/InspectionGadgets/src/com/siyeh/ig/junit/ContainsAssertionVisitor.java deleted file mode 100644 index 2a704aa5e813..000000000000 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/junit/ContainsAssertionVisitor.java +++ /dev/null @@ -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; - } -} diff --git a/plugins/InspectionGadgets/src/inspectionDescriptions/TestMethodWithoutAssertion.html b/plugins/InspectionGadgets/src/inspectionDescriptions/TestMethodWithoutAssertion.html index 96abcd45cc26..2fce3ce89bc8 100644 --- a/plugins/InspectionGadgets/src/inspectionDescriptions/TestMethodWithoutAssertion.html +++ b/plugins/InspectionGadgets/src/inspectionDescriptions/TestMethodWithoutAssertion.html @@ -3,7 +3,7 @@ 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. Powered by InspectionGadgets \ No newline at end of file