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());
}
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()));
}
Aggregations