Package ghidra.test
Class AbstractGhidraHeadedIntegrationTest
- java.lang.Object
-
- generic.test.AbstractGTest
-
- generic.test.AbstractGenericTest
-
- docking.test.AbstractDockingTest
-
- ghidra.test.AbstractGhidraHeadlessIntegrationTest
-
- ghidra.test.AbstractGhidraHeadedIntegrationTest
-
- Direct Known Subclasses:
AbstractProgramBasedTest
,AbstractScreenShotGenerator
,PythonInterpreterTest
,PythonPluginTest
,PythonScriptTest
public abstract class AbstractGhidraHeadedIntegrationTest extends AbstractGhidraHeadlessIntegrationTest
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class generic.test.AbstractGenericTest
AbstractGenericTest.ExceptionHandlingRunner
-
-
Field Summary
-
Fields inherited from class ghidra.test.AbstractGhidraHeadlessIntegrationTest
PROJECT_NAME
-
Fields inherited from class generic.test.AbstractGenericTest
concurrentTestExceptionRule, DEFAULT_TEST_TOOL_NAME, ruleChain, TESTDATA_DIRECTORY_NAME, watchman
-
Fields inherited from class generic.test.AbstractGTest
BATCH_MODE, DEFAULT_WAIT_DELAY, DEFAULT_WAIT_TIMEOUT, DEFAULT_WINDOW_TIMEOUT, PARALLEL_MODE, PRIVATE_LONG_WAIT_TIMEOUT, testName
-
-
Constructor Summary
Constructors Constructor Description AbstractGhidraHeadedIntegrationTest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <T extends Plugin>
TaddPlugin(PluginTool tool, java.lang.Class<T> c)
Adds the given plugin to the tool and then returns the instance of the plugin that was addedprotected void
click(FieldPanel fp, int clickCount, boolean wait)
void
click(ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin codeBrowser, int clickCount)
Triggers a browser click at the current cursor location.void
click(ghidra.app.plugin.core.codebrowser.CodeBrowserPlugin codeBrowser, int clickCount, boolean wait)
protected ApplicationConfiguration
createApplicationConfiguration()
protected ApplicationLayout
createApplicationLayout()
static DockingActionIf
getAction(DockingTool tool, java.lang.String owner, java.lang.String name)
Finds the action by the given owner name and action name.static DockingActionIf
getAction(Plugin plugin, java.lang.String actionName)
static DockingActionIf
getLocalAction(ComponentProvider provider, java.lang.String actionName)
static Plugin
getPluginByName(PluginTool tool, java.lang.String pluginName)
static PluginTool
saveTool(Project project, PluginTool tool)
Save the given tool to the project tool chest.static DialogComponentProvider
showDialogWithoutBlocking(PluginTool tool, DialogComponentProvider provider)
Shows the given DialogComponentProvider using the given tool'sPluginTool.showDialog(DialogComponentProvider)
method.static PluginTool
showTool(PluginTool tool)
static void
waitForAnalysis()
Deprecated.usewaitForBusyTool(PluginTool)
insteadstatic void
waitForBusyTool(PluginTool tool)
Waits for the tool to finish executing commands and tasksstatic void
waitForProgram(Program program)
Flushes the given program's events before waiting for the swing update manager-
Methods inherited from class ghidra.test.AbstractGhidraHeadlessIntegrationTest
applyCmd, createDefaultProgram, createDefaultProgram, debugProgramInTool, deleteProject, getLanguageCompilerSpecPair, getLanguageService, getPlugin, getSLEIGH_8051_LANGUAGE, getSLEIGH_X86_64_LANGUAGE, getSLEIGH_X86_LANGUAGE, getUniqueSymbol, getUniqueSymbol, getZ80_LANGUAGE, goTo, goTo, initializeSystemProperties, makeSelection, makeSelection, makeSelection, makeSelection, makeSelection, redo, redo, redo, replaceService, toAddressSet, toAddressSet, toAddressSet, undo, undo, undo, waitForScriptCompletion
-
Methods inherited from class docking.test.AbstractDockingTest
assertEnabled, assertToggleButtonSelected, capture, checkMessageDisplay, clickComponentProvider, clickComponentProvider, close, close, closeAllWindows, closeAllWindows, closeAllWindowsAndFrames, closeProvider, closeSaveChangesDialog, createRenderedImage, createScreenImage, disposeErrorGUI, dockingSetUp, dockingTearDown, expandPath, expandTree, findButtonByActionName, findButtonByIcon, findButtonByText, findComponent, findComponentByName, getAction, getAction, getActions, getClipboardText, getComponentProvider, getDialogComponent, getDialogComponentProvider, getDockableComponent, getNode, getOpenWindowsAsString, getStatusText, getTitleForWindow, getWindow, getWindowByTitle, getWindowByTitleContaining, getWindows, isEnabled, isEnabled, isSelected, isUseErrorGUI, performAction, performAction, performAction, performAction, performDialogAction, pressButtonByText, pressButtonByText, printOpenWindows, selectPath, selectTabIfAvailable, setErrorGUIEnabled, setErrorsExpected, setToggleActionSelected, setToggleActionSelected, setToggleButtonSelected, setToggleButtonSelected, showProvider, triggerActionKey, triggerActionKey, triggerBackspaceKey, triggerEnter, triggerEscapeKey, triggerKey, triggerKey, triggerText, triggerText, waitForComponentProvider, waitForComponentProvider, waitForDialogComponent, waitForDialogComponent, waitForDialogComponent, waitForJDialog, waitForJDialog, waitForTableModel, waitForTree, waitForUpdateOnChooser, waitForWindow, waitForWindow, waitForWindow, waitForWindow, waitForWindowByName, waitForWindowByTitleContaining, waitForWindowByTitleContaining, writeImage, writeImage
-
Methods inherited from class generic.test.AbstractGenericTest
clickMouse, clickMouse, clickTableCell, createStackTraceForAllThreads, createTempDirectory, createTempFile, createTempFile, createTempFileForTest, createTempFileForTest, createTempFilePath, createTempFilePath, deleteMatchingTempFiles, deleteSimilarTempFiles, doubleClick, dragMouse, editCell, executeOnSwingWithoutBlocking, findAbstractButtonByName, findAbstractButtonByText, findButtonByIcon, findButtonByText, findComponent, findComponent, findComponentByName, findComponentByName, findComponentsByName, findOwnedWindows, findPathToText, findTestDataFile, findTreePathToText, fixupGUI, getAllWindows, getDebugFileDirectory, getInstanceField, getInstanceFieldByClassType, getLocalResourceFile, getTestDataDir, getTestDataDirectory, getTestDataFile, getText, hasTestFailed, initializeLayout, invokeConstructor, invokeInstanceMethod, invokeInstanceMethod, leftClick, loadTextResource, loadTextResource, middleClick, moveMouse, postEvent, pressButton, pressButton, pressButtonByName, pressButtonByName, pressButtonByText, pressButtonByText, printMemory, privateWaitForPostedSwingRunnables_SwingSafe, rightClick, runSwing, runSwing, runSwing, setComboBoxSelection, setInstanceField, setText, testFailed, toString, waitForPostedSwingRunnables, waitForSwing, waitForTasks, windowForComponent, yieldToSwing
-
Methods inherited from class generic.test.AbstractGTest
assertArraysEqualOrdered, assertArraysEqualUnordered, assertArraysEqualUnordered, assertContainsExactly, assertContainsExactly, assertListEqualOrdered, assertListEqualOrdered, assertListEqualsArrayOrdered, assertListEqualsArrayUnordered, assertListEqualUnordered, failWithException, getName, getRandomInt, getRandomInt, getRandomString, getRandomString, getTestDirectoryPath, sleep, waitFor, waitFor, waitFor, waitForCondition, waitForCondition, waitForConditionWithoutFailing, waitForValue, waitForValueWithoutFailing
-
-
-
-
Method Detail
-
createApplicationLayout
protected ApplicationLayout createApplicationLayout()
- Overrides:
createApplicationLayout
in classAbstractGhidraHeadlessIntegrationTest
-
createApplicationConfiguration
protected ApplicationConfiguration createApplicationConfiguration()
- Overrides:
createApplicationConfiguration
in classAbstractGhidraHeadlessIntegrationTest
-
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 toolc
- 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 callAbstractDockingTest.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 actionsname
- the name to match- Returns:
- the matching action; null if no matching action can be found
-
getAction
public static DockingActionIf getAction(Plugin plugin, java.lang.String actionName)
-
getLocalAction
public static DockingActionIf getLocalAction(ComponentProvider provider, java.lang.String actionName)
-
showTool
public static PluginTool showTool(PluginTool tool)
-
showDialogWithoutBlocking
public static DialogComponentProvider showDialogWithoutBlocking(PluginTool tool, DialogComponentProvider provider)
Shows the given DialogComponentProvider using the given tool'sPluginTool.showDialog(DialogComponentProvider)
method. After calling show on a new thread the method will then wait for the dialog to be shown by callingTestEnv#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
-
waitForAnalysis
@Deprecated public static void waitForAnalysis()
Deprecated.usewaitForBusyTool(PluginTool)
instead
-
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 CodeBrowserPluginclickCount
- 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)
-
-