Package ghidra.test

Class AbstractGhidraHeadedIntegrationTest

    • Constructor Detail

      • AbstractGhidraHeadedIntegrationTest

        public AbstractGhidraHeadedIntegrationTest()
    • Method Detail

      • waitForProgram

        public static void waitForProgram​(Program program)
        Flushes the given program's events before waiting for the swing update manager
        Parameters:
        program - The program whose events will be flushed; may be null
      • addPlugin

        public static <T extends Plugin> T addPlugin​(PluginTool tool,
                                                     java.lang.Class<T> c)
                                              throws PluginException
        Adds the given plugin to the tool and then returns the instance of the plugin that was added
        Parameters:
        tool - the tool
        c - the class of the plugin to add
        Returns:
        the newly added plugin
        Throws:
        PluginException - if the plugin could not be constructed, or there was problem executing its init() method, or if a plugin of this class already exists in the tool
      • getPluginByName

        public static Plugin getPluginByName​(PluginTool tool,
                                             java.lang.String pluginName)
      • getAction

        public static DockingActionIf getAction​(DockingTool tool,
                                                java.lang.String owner,
                                                java.lang.String name)
        Finds the action by the given owner name and action name. If you do not know the owner name, then use the call AbstractDockingTest.getActions(DockingTool, String) instead.

        Note: more specific test case subclasses provide other methods for finding actions when you have an owner name (which is usually the plugin name).

        Parameters:
        tool - the tool containing all system actions
        name - the name to match
        Returns:
        the matching action; null if no matching action can be found
      • showDialogWithoutBlocking

        public static DialogComponentProvider showDialogWithoutBlocking​(PluginTool tool,
                                                                        DialogComponentProvider provider)
        Shows the given DialogComponentProvider using the given tool's PluginTool.showDialog(DialogComponentProvider) method. After calling show on a new thread the method will then wait for the dialog to be shown by calling TestEnv#waitForDialogComponent(Window, Class, int).
        Parameters:
        tool - The tool used to show the given provider.
        provider - The DialogComponentProvider to show.
        Returns:
        The provider once it has been shown, or null if the provider is not shown within the given maximum wait time.
      • waitForBusyTool

        public static void waitForBusyTool​(PluginTool tool)
        Waits for the tool to finish executing commands and tasks
        Parameters:
        tool - the tool
        Throws:
        junit.framework.AssertionFailedError - if the tool does not finish work within a reasonable limit
      • saveTool

        public static PluginTool saveTool​(Project project,
                                          PluginTool tool)
        Save the given tool to the project tool chest. If the tool already exists, then it will be overwritten with the given tool.
        Parameters:
        project - The project which with the tool is associated.
        tool - The tool to be saved
      • click

        public void click​(ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin codeBrowser,
                          int clickCount)
        Triggers a browser click at the current cursor location. Thus, this method should be called only after the browser location is set the the desired field.
        Parameters:
        codeBrowser - the CodeBrowserPlugin
        clickCount - the click count
      • click

        public void click​(ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin codeBrowser,
                          int clickCount,
                          boolean wait)
      • click

        protected void click​(FieldPanel fp,
                             int clickCount,
                             boolean wait)