Search in sources :

Example 1 with VisibilityInspection

use of com.intellij.codeInspection.visibility.VisibilityInspection in project intellij-community by JetBrains.

the class GlobalInspectionContextTest method testProblemDuplication.

public void testProblemDuplication() throws Exception {
    String shortName = new VisibilityInspection().getShortName();
    InspectionProfileImpl profile = new InspectionProfileImpl("Foo");
    ProjectInspectionManagerTestKt.disableAllTools(profile, getProject());
    profile.enableTool(shortName, getProject());
    GlobalInspectionContextImpl context = ((InspectionManagerEx) InspectionManager.getInstance(getProject())).createNewGlobalContext(false);
    context.setExternalProfile(profile);
    configureByFile("Foo.java");
    AnalysisScope scope = new AnalysisScope(getFile());
    context.doInspections(scope);
    // wait for launchInspections in invoke later
    UIUtil.dispatchAllInvocationEvents();
    Tools tools = context.getTools().get(shortName);
    GlobalInspectionToolWrapper toolWrapper = (GlobalInspectionToolWrapper) tools.getTool();
    InspectionToolPresentation presentation = context.getPresentation(toolWrapper);
    assertEquals(1, presentation.getProblemDescriptors().size());
    context.doInspections(scope);
    // wait for launchInspections in invoke later
    UIUtil.dispatchAllInvocationEvents();
    tools = context.getTools().get(shortName);
    toolWrapper = (GlobalInspectionToolWrapper) tools.getTool();
    presentation = context.getPresentation(toolWrapper);
    assertEquals(1, presentation.getProblemDescriptors().size());
}
Also used : AnalysisScope(com.intellij.analysis.AnalysisScope) InspectionToolPresentation(com.intellij.codeInspection.ui.InspectionToolPresentation) VisibilityInspection(com.intellij.codeInspection.visibility.VisibilityInspection)

Example 2 with VisibilityInspection

use of com.intellij.codeInspection.visibility.VisibilityInspection in project intellij-community by JetBrains.

the class FixAllQuickfixTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    enableInspectionTool(new GlobalInspectionToolWrapper(new VisibilityInspection()));
}
Also used : GlobalInspectionToolWrapper(com.intellij.codeInspection.ex.GlobalInspectionToolWrapper) VisibilityInspection(com.intellij.codeInspection.visibility.VisibilityInspection)

Aggregations

VisibilityInspection (com.intellij.codeInspection.visibility.VisibilityInspection)2 AnalysisScope (com.intellij.analysis.AnalysisScope)1 GlobalInspectionToolWrapper (com.intellij.codeInspection.ex.GlobalInspectionToolWrapper)1 InspectionToolPresentation (com.intellij.codeInspection.ui.InspectionToolPresentation)1