Search in sources :

Example 16 with TestActionEvent

use of com.intellij.testFramework.TestActionEvent in project intellij-plugins by JetBrains.

the class FlexExtractSuperTest method checkAction.

private void checkAction(String actionId, boolean enabled, int pos) {
    AnAction action = ActionManager.getInstance().getAction(actionId);
    AnActionEvent e = new TestActionEvent(DataManager.getInstance().getDataContext(getEditor().getComponent()), action);
    action.beforeActionPerformedUpdate(e);
    assertEquals("Action " + actionId + " should be " + (enabled ? "enabled" : "disabled") + " at position " + pos, enabled, e.getPresentation().isEnabled());
}
Also used : AnActionEvent(com.intellij.openapi.actionSystem.AnActionEvent) AnAction(com.intellij.openapi.actionSystem.AnAction) TestActionEvent(com.intellij.testFramework.TestActionEvent)

Aggregations

TestActionEvent (com.intellij.testFramework.TestActionEvent)16 AnAction (com.intellij.openapi.actionSystem.AnAction)4 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)3 CreateFromTemplateGroup (com.intellij.ide.fileTemplates.actions.CreateFromTemplateGroup)2 FileTemplateManagerImpl (com.intellij.ide.fileTemplates.impl.FileTemplateManagerImpl)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 RenameElementAction (com.intellij.refactoring.actions.RenameElementAction)2 MapDataContext (com.intellij.testFramework.MapDataContext)2 TestDataProvider (com.intellij.testFramework.TestDataProvider)2 Arrays (java.util.Arrays)2 List (java.util.List)2 GutterMark (com.intellij.codeInsight.daemon.GutterMark)1 IdeBundle (com.intellij.ide.IdeBundle)1 GotoRelatedSymbolAction (com.intellij.ide.actions.GotoRelatedSymbolAction)1 CreateFromTemplateAction (com.intellij.ide.fileTemplates.actions.CreateFromTemplateAction)1 BrowseTypeHierarchyAction (com.intellij.ide.hierarchy.actions.BrowseTypeHierarchyAction)1 LanguageFormatting (com.intellij.lang.LanguageFormatting)1 LanguageImportStatements (com.intellij.lang.LanguageImportStatements)1 com.intellij.openapi.actionSystem (com.intellij.openapi.actionSystem)1 ActionGroup (com.intellij.openapi.actionSystem.ActionGroup)1