Search in sources :

Example 1 with SillyAssignmentInspection

use of com.intellij.codeInspection.sillyAssignment.SillyAssignmentInspection in project intellij-community by JetBrains.

the class SuppressExternalTest method setUp.

@Override
public void setUp() throws Exception {
    super.setUp();
    final IdeaTestFixtureFactory fixtureFactory = IdeaTestFixtureFactory.getFixtureFactory();
    final TestFixtureBuilder<IdeaProjectTestFixture> testFixtureBuilder = fixtureFactory.createFixtureBuilder(getName());
    myFixture = JavaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(testFixtureBuilder.getFixture());
    myFixture.setTestDataPath(PathManagerEx.getTestDataPath() + "/codeInsight/externalAnnotations");
    final JavaModuleFixtureBuilder builder = testFixtureBuilder.addModule(JavaModuleFixtureBuilder.class);
    new File(myFixture.getTempDirPath() + "/src/").mkdir();
    builder.addContentRoot(myFixture.getTempDirPath()).addSourceRoot("src");
    builder.setMockJdkLevel(JavaModuleFixtureBuilder.MockJdkLevel.jdk15);
    myFixture.setUp();
    myFixture.enableInspections(new SillyAssignmentInspection());
    addAnnotationsModuleRoot();
    final JavaPsiFacade facade = JavaPsiFacade.getInstance(myFixture.getProject());
    myLanguageLevel = LanguageLevelProjectExtension.getInstance(facade.getProject()).getLanguageLevel();
    LanguageLevelProjectExtension.getInstance(facade.getProject()).setLanguageLevel(LanguageLevel.JDK_1_5);
}
Also used : JavaPsiFacade(com.intellij.psi.JavaPsiFacade) JavaModuleFixtureBuilder(com.intellij.testFramework.builders.JavaModuleFixtureBuilder) SillyAssignmentInspection(com.intellij.codeInspection.sillyAssignment.SillyAssignmentInspection) File(java.io.File)

Aggregations

SillyAssignmentInspection (com.intellij.codeInspection.sillyAssignment.SillyAssignmentInspection)1 JavaPsiFacade (com.intellij.psi.JavaPsiFacade)1 JavaModuleFixtureBuilder (com.intellij.testFramework.builders.JavaModuleFixtureBuilder)1 File (java.io.File)1