test fixes

This commit is contained in:
dragonmacher 2022-12-13 16:46:52 -05:00
parent ce0333d589
commit 27016ed926
2 changed files with 9 additions and 9 deletions

View file

@ -264,7 +264,7 @@ public class DataTypeSelectionDialogTest extends AbstractGhidraHeadedIntegration
} }
private void waitForDialogToClose(DockingDialog dockingDialog) { private void waitForDialogToClose(DockingDialog dockingDialog) {
waitForCondition(() -> !dialog.isShowing(), "Dialog did not close!"); waitForCondition(() -> !dockingDialog.isShowing(), "Dialog did not close!");
waitForSwing(); waitForSwing();
} }

View file

@ -154,7 +154,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
final ToolButton cbButton = findToolButton(frontEndTool.getToolFrame(), "Untitled", false); final ToolButton cbButton = findToolButton(frontEndTool.getToolFrame(), "Untitled", false);
runSwing(() -> cbButton.doClick()); runSwing(() -> cbButton.doClick());
// the button click triggers an animation, and then launches the tool, so we must wait // the button click triggers an animation, and then launches the tool, so we must wait
// for the window to appear // for the window to appear
Window window = waitForWindow("Untitled(2)"); Window window = waitForWindow("Untitled(2)");
assertNotNull(window); assertNotNull(window);
@ -175,8 +175,8 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
int count = tc.getToolCount(); int count = tc.getToolCount();
String toolNamePrefix = "TestCodeBrowser"; String toolNamePrefix = "TestCodeBrowser";
final File cbFile = ResourceManager.getResourceFile( final File cbFile = ResourceManager
"defaultTools/" + toolNamePrefix + ToolUtils.TOOL_EXTENSION); .getResourceFile("defaultTools/" + toolNamePrefix + ToolUtils.TOOL_EXTENSION);
assertNotNull(cbFile); assertNotNull(cbFile);
DockingActionIf importAction = getAction("Import Tool"); DockingActionIf importAction = getAction("Import Tool");
@ -218,7 +218,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
Project project = frontEndTool.getProject(); Project project = frontEndTool.getProject();
DataTree tree = findComponent(frontEndTool.getToolFrame(), DataTree.class); DataTree tree = findComponent(frontEndTool.getToolFrame(), DataTree.class);
// TODO: move to method // TODO: move to method
DomainFolder rootFolder = project.getProjectData().getRootFolder(); DomainFolder rootFolder = project.getProjectData().getRootFolder();
Program p = buildProgram("notepad"); Program p = buildProgram("notepad");
rootFolder.createFile("notepad", p, TaskMonitor.DUMMY); rootFolder.createFile("notepad", p, TaskMonitor.DUMMY);
@ -344,7 +344,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
// //
// edit the association // edit the association
// //
// find the 'Program' entry // find the 'Program' entry
rowCount = associationTable.getRowCount(); rowCount = associationTable.getRowCount();
programRow = -1; programRow = -1;
for (int i = 0; i < rowCount; i++) { for (int i = 0; i < rowCount; i++) {
@ -413,7 +413,7 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
assertTrue(!cb.isSelected()); assertTrue(!cb.isSelected());
} }
final JButton selectAllButton = (JButton) getInstanceField("selectAllButton", d); JButton selectAllButton = findButtonByText(d, "Select All");
runSwing(() -> selectAllButton.doClick()); runSwing(() -> selectAllButton.doClick());
pressButtonByText(d, "OK"); pressButtonByText(d, "OK");
@ -433,8 +433,8 @@ public class ToolActionManagerTest extends AbstractGhidraHeadedIntegrationTest {
} }
newList.removeAll(origList); newList.removeAll(origList);
runSwing(() -> { runSwing(() -> {
for (int i = 0; i < newList.size(); i++) { for (String element : newList) {
tc.remove(newList.get(i)); tc.remove(element);
} }
}); });
assertEquals(origList.size(), tc.getToolCount()); assertEquals(origList.size(), tc.getToolCount());