use of com.intellij.refactoring.typeMigration.inspections.GuavaInspection in project intellij-community by JetBrains.
the class GuavaInspectionTest method doTest.
private void doTest() {
myFixture.configureByFile(getTestName(true) + ".java");
myFixture.enableInspections(new GuavaInspection());
boolean actionFound = false;
myFixture.doHighlighting();
for (IntentionAction action : myFixture.getAvailableIntentions()) {
if (action instanceof GuavaInspection.MigrateGuavaTypeFix) {
myFixture.launchAction(action);
actionFound = true;
break;
}
}
assertTrue("Quick fix isn't found", actionFound);
myFixture.checkResultByFile(getTestName(true) + "_after.java");
}
use of com.intellij.refactoring.typeMigration.inspections.GuavaInspection 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");
}
use of com.intellij.refactoring.typeMigration.inspections.GuavaInspection in project intellij-community by JetBrains.
the class GuavaInspectionTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
myInspection = new GuavaInspection();
myFixture.enableInspections(myInspection);
}
Aggregations