use of com.intellij.codeInsight.daemon.impl.quickfix.AddMethodQualifierFix in project intellij-community by JetBrains.
the class AddMethodQualifierTest method doTest.
private void doTest(final String... candidatesNames) {
myFixture.configureByFile(getTestName(false) + ".java");
final AddMethodQualifierFix addMethodQualifierFix = getQuickFix();
if (candidatesNames.length == 0) {
assertNull(addMethodQualifierFix);
return;
}
assertNotNull(addMethodQualifierFix);
final Set<String> actualCandidatesNames = new TreeSet<>(ContainerUtil.map(addMethodQualifierFix.getCandidates(), new Function<PsiNamedElement, String>() {
@Override
public String fun(final PsiNamedElement psiNamedElement) {
final String name = psiNamedElement.getName();
assertNotNull(name);
return name;
}
}));
final Set<String> expectedCandidatesNames = new TreeSet<>(ContainerUtil.list(candidatesNames));
assertEquals(expectedCandidatesNames, actualCandidatesNames);
}
use of com.intellij.codeInsight.daemon.impl.quickfix.AddMethodQualifierFix in project intellij-community by JetBrains.
the class AddMethodQualifierTest method getQuickFix.
@Nullable
private AddMethodQualifierFix getQuickFix() {
final List<IntentionAction> availableIntentions = myFixture.getAvailableIntentions();
AddMethodQualifierFix addMethodQualifierFix = null;
for (final IntentionAction availableIntention : availableIntentions) {
if (availableIntention instanceof AddMethodQualifierFix) {
addMethodQualifierFix = (AddMethodQualifierFix) availableIntention;
break;
}
}
return addMethodQualifierFix;
}
use of com.intellij.codeInsight.daemon.impl.quickfix.AddMethodQualifierFix in project intellij-community by JetBrains.
the class AddMethodQualifierTest method doTestFix.
private void doTestFix() {
myFixture.configureByFile(getTestName(false) + "Before.java");
final AddMethodQualifierFix quickFix = getQuickFix();
assertNotNull(quickFix);
myFixture.launchAction(quickFix);
myFixture.checkResultByFile(getTestName(false) + "After.java");
}
Aggregations