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
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, DEFAULT_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 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(Plugin plugin, 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'sAbstractDockingTool.showDialog(DialogComponentProvider)
method.static PluginTool
showTool(PluginTool tool)
static 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, createInProgram, 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, modifyProgram, redo, redo, redo, replaceService, toAddressSet, toAddressSet, toAddressSet, tx, undo, undo, undo, waitForScriptCompletion
-
Methods inherited from class docking.test.AbstractDockingTest
assertEnabled, assertToggleButtonSelected, capture, checkMessageDisplay, clickComponentProvider, clickComponentProvider, close, close, closeAllWindows, closeAllWindows, closeAllWindowsAndFrames, closeProvider, closeSaveChangesDialog, createContext, createContext, createRenderedImage, createScreenImage, disposeErrorGUI, dockingSetUp, dockingTearDown, expandPath, expandTree, findButtonByActionName, findButtonByIcon, findButtonByText, findComponent, findComponentByName, getAction, getAction, getAction, getActionsByName, getActionsByOwner, getActionsByOwnerAndName, getClipboardText, getComponentProvider, getDialogComponent, getDialogComponentProvider, getDockableComponent, getLocalAction, 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, runSwingWithExceptions, 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, waitFor, waitForCondition, 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)
-
showTool
public static PluginTool showTool(PluginTool tool)
-
showDialogWithoutBlocking
public static DialogComponentProvider showDialogWithoutBlocking(PluginTool tool, DialogComponentProvider provider)
Shows the given DialogComponentProvider using the given tool'sAbstractDockingTool.showDialog(DialogComponentProvider)
method.- 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
-
getAction
public static DockingActionIf getAction(Plugin plugin, java.lang.String actionName)
-
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- Returns:
- the new tool
-
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)
-
-