Test fixes

This commit is contained in:
dragonmacher 2024-12-04 18:18:21 -05:00
parent 051a0b3405
commit 33b9315c18
10 changed files with 61 additions and 46 deletions

View file

@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -33,7 +33,7 @@ import ghidra.util.exception.InvalidInputException;
public class DiffApplyMergeTest extends DiffApplyTestAdapter {
@Override
public void tearDown() {
public void tearDown() throws Exception {
closeAllWindows();
super.tearDown();

View file

@ -501,13 +501,15 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
}
@After
public void tearDown() {
public void tearDown() throws Exception {
Window win = getWindow("Select Other Program");
if (win != null) {
pressButton(win, "Cancel");
}
closeDiff();
env.dispose();
}
@ -516,8 +518,16 @@ public class DiffTestAdapter extends AbstractGhidraHeadedIntegrationTest {
performAction(setView, context, true);
}
protected boolean isDiffActive() {
return runSwing(() -> diffPlugin.isDiffActive());
}
void closeDiff() throws Exception {
if (!isDiffActive()) {
return;
}
closeDiffByAction();
DialogComponentProvider dialogProvider = waitForDialogComponent("Close Diff Session");
assertNotNull("Did not get confirmation dialog", dialogProvider);

View file

@ -230,9 +230,6 @@ public class DualProgramTest extends DiffTestAdapter {
ProgramDB otherProgram = otherBuilder.getProgram();
otherBuilder.createMemory(".stuff", "0x1004000", 0x300);
Window win;
Component comp;
//InfoWindow.showSplashScreen();
showTool(frontEndTool);
env.showTool();
@ -241,9 +238,9 @@ public class DualProgramTest extends DiffTestAdapter {
launchDiffByAction();
waitForSwing();
win = waitForWindow("Select Other Program");
Window win = waitForWindow("Select Other Program");
assertNotNull(win);
comp = getComponentOfType(win, JComboBox.class);
Component comp = getComponentOfType(win, JComboBox.class);
assertNotNull(comp);
JTree tree = findComponent(win, JTree.class);