more assertions for blinking test

This commit is contained in:
peter
2010-07-05 19:00:30 +01:00
parent 32c39d9ca6
commit 728b05f63c
2 changed files with 4 additions and 3 deletions
@@ -370,7 +370,7 @@ public abstract class DaemonAnalyzerTestCase extends CodeInsightTestCase {
IntentionAction intentionAction = findIntentionAction(infos, intentionActionName, editor, file);
assertNotNull(intentionActionName, intentionAction);
ShowIntentionActionsHandler.chooseActionAndInvoke(file, editor, intentionAction, intentionActionName);
assertTrue(ShowIntentionActionsHandler.chooseActionAndInvoke(file, editor, intentionAction, intentionActionName));
}
protected static IntentionAction findIntentionAction(final Collection<HighlightInfo> infos, final String intentionActionName, final Editor editor,
@@ -193,7 +193,7 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler {
return Pair.create(fileToApply, editorToApply);
}
public static void chooseActionAndInvoke(PsiFile hostFile, final Editor hostEditor, final IntentionAction action, final String text) {
public static boolean chooseActionAndInvoke(PsiFile hostFile, final Editor hostEditor, final IntentionAction action, final String text) {
final Project project = hostFile.getProject();
Pair<PsiFile, Editor> pair = chooseBetweenHostAndInjected(hostFile, hostEditor, new PairProcessor<PsiFile, Editor>() {
@@ -201,7 +201,7 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler {
return availableFor(psiFile, editor, action);
}
});
if (pair == null) return;
if (pair == null) return false;
final Editor editorToApply = pair.second;
final PsiFile fileToApply = pair.first;
@@ -227,5 +227,6 @@ public class ShowIntentionActionsHandler implements CodeInsightActionHandler {
}
CommandProcessor.getInstance().executeCommand(project, runnable, text, null);
return true;
}
}