Search in sources :

Example 1 with SSBasedInspection

use of com.intellij.structuralsearch.inspection.highlightTemplate.SSBasedInspection in project intellij-community by JetBrains.

the class SSBasedInspectionTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    SSBasedInspection inspection = new SSBasedInspection();
    List<Configuration> configurations = new ArrayList<>();
    SearchConfiguration configuration = new SearchConfiguration();
    MatchOptions options = new MatchOptions();
    options.setFileType(StdFileTypes.JAVA);
    options.setSearchPattern("int i;");
    configuration.setMatchOptions(options);
    configurations.add(configuration);
    configuration = new SearchConfiguration();
    options = new MatchOptions();
    options.setFileType(StdFileTypes.JAVA);
    options.setSearchPattern("f();");
    configuration.setMatchOptions(options);
    configurations.add(configuration);
    inspection.setConfigurations(configurations, myProject);
    myWrapper = new LocalInspectionToolWrapper(inspection);
}
Also used : Configuration(com.intellij.structuralsearch.plugin.ui.Configuration) SearchConfiguration(com.intellij.structuralsearch.plugin.ui.SearchConfiguration) ArrayList(java.util.ArrayList) SSBasedInspection(com.intellij.structuralsearch.inspection.highlightTemplate.SSBasedInspection) SearchConfiguration(com.intellij.structuralsearch.plugin.ui.SearchConfiguration) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper)

Example 2 with SSBasedInspection

use of com.intellij.structuralsearch.inspection.highlightTemplate.SSBasedInspection in project intellij-community by JetBrains.

the class SSRCodeInsightTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    IdeaTestFixtureFactory factory = IdeaTestFixtureFactory.getFixtureFactory();
    TestFixtureBuilder<IdeaProjectTestFixture> fixtureBuilder = factory.createLightFixtureBuilder(new DefaultLightProjectDescriptor());
    final IdeaProjectTestFixture fixture = fixtureBuilder.getFixture();
    myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture, new LightTempDirTestFixtureImpl(true));
    myInspection = new SSBasedInspection();
    myFixture.setUp();
    myFixture.enableInspections(myInspection);
    myFixture.setTestDataPath(getTestDataPath());
}
Also used : SSBasedInspection(com.intellij.structuralsearch.inspection.highlightTemplate.SSBasedInspection) LightTempDirTestFixtureImpl(com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl)

Aggregations

SSBasedInspection (com.intellij.structuralsearch.inspection.highlightTemplate.SSBasedInspection)2 LocalInspectionToolWrapper (com.intellij.codeInspection.ex.LocalInspectionToolWrapper)1 Configuration (com.intellij.structuralsearch.plugin.ui.Configuration)1 SearchConfiguration (com.intellij.structuralsearch.plugin.ui.SearchConfiguration)1 LightTempDirTestFixtureImpl (com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl)1 ArrayList (java.util.ArrayList)1