use of com.intellij.codeInspection.actions.CleanupInspectionIntention in project intellij-community by JetBrains.
the class GuavaInspectionTest method doTestAllFile.
private void doTestAllFile() {
myFixture.configureByFile(getTestName(true) + ".java");
myFixture.enableInspections(new GuavaInspection());
for (HighlightInfo info : myFixture.doHighlighting()) if (GuavaInspection.PROBLEM_DESCRIPTION.equals(info.getDescription())) {
final Pair<HighlightInfo.IntentionActionDescriptor, RangeMarker> marker = info.quickFixActionMarkers.get(0);
final PsiElement someElement = myFixture.getFile().findElementAt(0);
assertNotNull(someElement);
final List<IntentionAction> options = marker.getFirst().getOptions(someElement, myFixture.getEditor());
assertNotNull(options);
boolean doBreak = false;
for (IntentionAction option : options) {
if (option instanceof CleanupInspectionIntention) {
myFixture.launchAction(option);
doBreak = true;
break;
}
}
if (doBreak) {
break;
}
}
myFixture.checkResultByFile(getTestName(true) + "_after.java");
}
Aggregations