diff --git a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties index 99bbf214169c..15c278cfa46d 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties +++ b/plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/InspectionGadgetsBundle.properties @@ -1944,7 +1944,7 @@ class.only.used.in.one.package.display.name=Class only used from one other packa class.only.used.in.one.package.problem.descriptor=Class #ref has only dependencies on and/or dependents in package ''{0}'' #loc unnecessary.return.option=Ignore in then branch of 'if' statement with 'else' branch usage.of.obsolete.assert.display.name=Usage of obsolete 'junit.framework.Assert' -use.of.obsolete.assert.problem.descriptor=Call to #ref() from 'org.junit.framework.Assert' should be replaced with call to method from 'org.junit.Assert' #loc +use.of.obsolete.assert.problem.descriptor=Call to #ref() from 'junit.framework.Assert' should be replaced with call to method from 'org.junit.Assert' #loc 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()' diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/junit/use_of_obsolete_assert/ObsoleteAssert.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/junit/use_of_obsolete_assert/ObsoleteAssert.java new file mode 100644 index 000000000000..4087eb8d7bbf --- /dev/null +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/junit/use_of_obsolete_assert/ObsoleteAssert.java @@ -0,0 +1,8 @@ +package com.siyeh.igtest.junit.use_of_obsolete_assert; + +public class ObsoleteAssert { + + public void testMe(int s) { + junit.framework.Assert.assertEquals("asdfasd", -1, s); + } +} diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/junit/UseOfObsoleteAssertInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/junit/UseOfObsoleteAssertInspectionTest.java new file mode 100644 index 000000000000..19826e2c091e --- /dev/null +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/junit/UseOfObsoleteAssertInspectionTest.java @@ -0,0 +1,44 @@ +/* + * Copyright 2000-2013 JetBrains s.r.o. + * + * 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.codeInspection.InspectionProfileEntry; +import com.siyeh.ig.LightInspectionTestCase; + +/** + * @author Bas Leijdekkers + */ +public class UseOfObsoleteAssertInspectionTest extends LightInspectionTestCase { + + public void testObsoleteAssert() { doTest(); } + + @Override + protected String[] getEnvironmentClasses() { + return new String[] { + "package junit.framework;" + + "public class Assert {" + + " static public void assertEquals(String message, int expected, int actual) {}" + + "}", + "package org.junit;" + + "public class Assert {}" + }; + } + + @Override + protected InspectionProfileEntry getInspection() { + return new UseOfObsoleteAssertInspection(); + } +}