IG: check for TestCase too
[idea/community.git] / plugins / InspectionGadgets / testsrc / com / siyeh / ig / junit / UseOfObsoleteAssertInspectionTest.java
1 /*
2  * Copyright 2000-2016 JetBrains s.r.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package com.siyeh.ig.junit;
17
18 import com.intellij.codeInspection.InspectionProfileEntry;
19 import com.siyeh.ig.LightInspectionTestCase;
20
21 /**
22  * @author Bas Leijdekkers
23  */
24 public class UseOfObsoleteAssertInspectionTest extends LightInspectionTestCase {
25
26   public void testObsoleteAssert() { doTest(); }
27
28   @Override
29   protected String[] getEnvironmentClasses() {
30     return new String[] {
31       "package junit.framework;" +
32       "public class Assert {" +
33       "  static public void assertEquals(String message, int expected, int actual) {}" +
34       "}",
35
36       "package junit.framework;" +
37       "public class TestCase extends Assert {" +
38       "  public static void assertEquals(String message, int expected, int actual) {" +
39       "    Assert.assertEquals(message, expected, actual);" +
40       "  }" +
41       "}",
42
43       "package org.junit;" +
44       "public class Assert {}"
45     };
46   }
47
48   @Override
49   protected InspectionProfileEntry getInspection() {
50     return new UseOfObsoleteAssertInspection();
51   }
52 }