add a test for the dev kit inspection: try to write stateless EP;
[idea/community.git] / plugins / devkit / testSources / inspections / StatefulEpInspectionTest.java
1 /*
2  * Copyright 2000-2015 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 org.jetbrains.idea.devkit.inspections;
17
18 import com.intellij.openapi.application.PluginPathManager;
19 import com.intellij.testFramework.TestDataPath;
20
21 @TestDataPath("$CONTENT_ROOT/testData/inspections/statefulEp")
22 public class StatefulEpInspectionTest extends PluginModuleTestCase {
23   @Override
24   protected String getBasePath() {
25     return PluginPathManager.getPluginHomePathRelative("devkit") + "/testData/inspections/statefulEp";
26   }
27
28   @Override
29   protected void setUp() throws Exception {
30     super.setUp();
31     myFixture.addClass("package com.intellij.openapi.project; public class Project {}");
32     myFixture.addClass("package com.intellij.psi; public class PsiElement {}");
33     myFixture.addClass("package com.intellij.psi; public class PsiReference {}");
34     myFixture.addClass("package com.intellij.codeInspection; public class LocalQuickFix {}");
35     myFixture.enableInspections(new StatefulEpInspection());
36   }
37
38   public void testLocalQuickFix() {
39     myFixture.testHighlighting("Fix.java");
40   }
41
42   public void testNonFix() {
43     myFixture.testHighlighting("NonFix.java");
44   }
45
46   public void testExt() {
47     setPluginXml("plugin.xml");
48     myFixture.testHighlighting("Ext.java");
49   }
50 }