Test fixes

This commit is contained in:
dragonmacher 2023-01-31 14:35:16 -05:00
parent c88a8a7040
commit c80297eaac
2 changed files with 80 additions and 102 deletions

View file

@ -65,7 +65,6 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
private AddressSet destinationSelection; private AddressSet destinationSelection;
public VTAddToSessionTest() { public VTAddToSessionTest() {
super();
} }
@Before @Before
@ -129,8 +128,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -146,12 +144,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" + "Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" +
"Entire Destination Program<br>" + "</html>"; "Entire Destination Program<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -185,8 +183,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -208,12 +205,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" + "Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" +
"Entire Destination Program<br>" + "</html>"; "Entire Destination Program<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -247,8 +244,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -270,12 +266,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" + "Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" +
"Manually Defined<br>" + "</html>"; "Manually Defined<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -309,8 +305,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -345,12 +340,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" + "Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" +
"Manually Defined<br>" + "</html>"; "Manually Defined<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -386,8 +381,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -409,12 +403,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" + "Exact Function Instructions Match<br>" + "No<br>" + "Entire Source Program<br>" +
"Entire Destination Program<br>" + "</html>"; "Entire Destination Program<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -450,8 +444,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -473,12 +466,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>No<br>Source Tool Selection<br>" + "Exact Function Instructions Match<br>No<br>Source Tool Selection<br>" +
"Destination Tool Selection<br></html>"; "Destination Tool Selection<br></html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -514,8 +507,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -550,12 +542,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" + "Exact Function Instructions Match<br>" + "No<br>" + "Manually Defined<br>" +
"Manually Defined<br>" + "</html>"; "Manually Defined<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -591,8 +583,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -626,12 +617,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel and then begin going back through wizard panels. // Check the summary panel and then begin going back through wizard panels.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Exact Function Instructions Match<br>" + "Yes<br>" + "Manually Defined<br>" + "Exact Function Instructions Match<br>" + "Yes<br>" + "Manually Defined<br>" +
"Manually Defined<br>" + "</html>"; "Manually Defined<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.BACK); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.BACK);
@ -693,8 +684,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
createWizardManager(); createWizardManager();
runSwingLater( runSwingLater(() -> wizardManager.showWizard(controller.getParentComponent()));
() -> wizardManager.showWizard(controller.getParentComponent()));
waitForDialogComponent(WizardManager.class); waitForDialogComponent(WizardManager.class);
@ -710,12 +700,12 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + sessionName + String summaryString = "Add to Version Tracking Session<br>" + sessionName + "<br>" +
"<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" + TEST_SOURCE_PROGRAM_NAME + "<br>" + TEST_DESTINATION_PROGRAM_NAME + "<br>" +
"Data Reference Match<br>" + "No<br>" + "Entire Source Program<br>" + "Data Reference Match<br>" + "No<br>" + "Entire Source Program<br>" +
"Entire Destination Program<br>" + "</html>"; "Entire Destination Program<br>" + "</html>";
checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH); checkSummaryPanel(labelString, summaryString, VTWizardPanelAction.FINISH);
@ -790,7 +780,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// options.putString(testOptionKey, firstNewOptionValue); // options.putString(testOptionKey, firstNewOptionValue);
// assertEquals(firstNewOptionValue, options.getString(testOptionKey, null)); // assertEquals(firstNewOptionValue, options.getString(testOptionKey, null));
// correlator.setOptions(LCSAddressCorrelator.class, options); // correlator.setOptions(LCSAddressCorrelator.class, options);
// // save the options // // save the options
// SaveState saveState = new SaveState(); // SaveState saveState = new SaveState();
// controller.writeConfigState(saveState); // controller.writeConfigState(saveState);
// //
@ -800,7 +790,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
// correlator.setOptions(LCSAddressCorrelator.class, options); // correlator.setOptions(LCSAddressCorrelator.class, options);
// //
// // pull the values again and make sure they are still correct (that writing the config // // pull the values again and make sure they are still correct (that writing the config
// // state did not change the cached controller and options) // // state did not change the cached controller and options)
// correlator = controller.getCorrelator(); // correlator = controller.getCorrelator();
// options = correlator.getOptions(LCSAddressCorrelator.class); // options = correlator.getOptions(LCSAddressCorrelator.class);
// assertEquals(secondNewValue, options.getString(testOptionKey, null)); // assertEquals(secondNewValue, options.getString(testOptionKey, null));
@ -820,9 +810,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel); (JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
assertNotNull(excludeCheckbox); assertNotNull(excludeCheckbox);
JCheckBox showAddressSetPanelsCheckbox = JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox", .getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
addressSetOptionsPanel);
assertNotNull(showAddressSetPanelsCheckbox); assertNotNull(showAddressSetPanelsCheckbox);
assertEquals("Exclude Accepted Matches checkbox", excludeAccepted, assertEquals("Exclude Accepted Matches checkbox", excludeAccepted,
@ -844,9 +833,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel); (JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
assertNotNull(excludeCheckbox); assertNotNull(excludeCheckbox);
JCheckBox showAddressSetPanelsCheckbox = JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox", .getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
addressSetOptionsPanel);
assertNotNull(showAddressSetPanelsCheckbox); assertNotNull(showAddressSetPanelsCheckbox);
if (excludeCheckbox.isSelected() != excludeAccepted) { if (excludeCheckbox.isSelected() != excludeAccepted) {
@ -908,9 +896,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
AddressSetView panelSourceSet = AddressSetView panelSourceSet =
(AddressSetView) TestUtils.invokeInstanceMethod("getAddressSetView", sourceSetPanel); (AddressSetView) TestUtils.invokeInstanceMethod("getAddressSetView", sourceSetPanel);
AddressSetView panelDestinationSet = AddressSetView panelDestinationSet = (AddressSetView) TestUtils
(AddressSetView) TestUtils.invokeInstanceMethod("getAddressSetView", .invokeInstanceMethod("getAddressSetView", destinationSetPanel);
destinationSetPanel);
assertEquals("Source Address Set", desiredSourceSet, panelSourceSet); assertEquals("Source Address Set", desiredSourceSet, panelSourceSet);
assertEquals("Destination Address Set", desiredDestinationSet, panelDestinationSet); assertEquals("Destination Address Set", desiredDestinationSet, panelDestinationSet);
} }
@ -1003,8 +990,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
(ChooseAddressSetEditorPanel) TestUtils.getInstanceField("panel", addressSetPanel); (ChooseAddressSetEditorPanel) TestUtils.getInstanceField("panel", addressSetPanel);
assertNotNull(panel); assertNotNull(panel);
JButton addRangeButton = JButton addRangeButton = (JButton) TestUtils.getInstanceField("addRangeButton", panel);
(JButton) TestUtils.getInstanceField("addRangeButton", panel);
assertNotNull("Couldn't get button for adding address range.", addRangeButton); assertNotNull("Couldn't get button for adding address range.", addRangeButton);
JButton listRemoveRangeButton = JButton listRemoveRangeButton =
(JButton) TestUtils.getInstanceField("removeRangeButton", panel); (JButton) TestUtils.getInstanceField("removeRangeButton", panel);
@ -1034,8 +1020,7 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
(ChooseAddressSetEditorPanel) TestUtils.getInstanceField("panel", addressSetPanel); (ChooseAddressSetEditorPanel) TestUtils.getInstanceField("panel", addressSetPanel);
assertNotNull(panel); assertNotNull(panel);
JButton addRangeButton = JButton addRangeButton = (JButton) TestUtils.getInstanceField("addRangeButton", panel);
(JButton) TestUtils.getInstanceField("addRangeButton", panel);
JButton subtractRangeButton = JButton subtractRangeButton =
(JButton) TestUtils.getInstanceField("subtractRangeButton", panel); (JButton) TestUtils.getInstanceField("subtractRangeButton", panel);
@ -1051,8 +1036,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
} }
} }
private void enterAddressRange(boolean isSource, String buttonText, private void enterAddressRange(boolean isSource, String buttonText, String minAddress,
String minAddress, String maxAddress) { String maxAddress) {
AddRemoveAddressRangeDialog addRemoveDialog = AddRemoveAddressRangeDialog addRemoveDialog =
waitForDialogComponent(AddRemoveAddressRangeDialog.class); waitForDialogComponent(AddRemoveAddressRangeDialog.class);
@ -1087,8 +1072,8 @@ public class VTAddToSessionTest extends AbstractGhidraHeadedIntegrationTest {
assertTrue("Dialog not closed after pressing: " + buttonText, !addRemoveDialog.isShowing()); assertTrue("Dialog not closed after pressing: " + buttonText, !addRemoveDialog.isShowing());
} }
private void enterAddressRange(boolean isSource, String buttonText, private void enterAddressRange(boolean isSource, String buttonText, Address minAddress,
Address minAddress, Address maxAddress) { Address maxAddress) {
AddRemoveAddressRangeDialog addRemoveDialog = AddRemoveAddressRangeDialog addRemoveDialog =
waitForDialogComponent(AddRemoveAddressRangeDialog.class); waitForDialogComponent(AddRemoveAddressRangeDialog.class);

View file

@ -51,7 +51,6 @@ import ghidra.program.model.listing.Library;
import ghidra.program.model.listing.Program; import ghidra.program.model.listing.Program;
import ghidra.program.model.symbol.*; import ghidra.program.model.symbol.*;
import ghidra.test.AbstractGhidraHeadedIntegrationTest; import ghidra.test.AbstractGhidraHeadedIntegrationTest;
import ghidra.util.HTMLUtilities;
import ghidra.util.Msg; import ghidra.util.Msg;
import ghidra.util.table.GhidraTable; import ghidra.util.table.GhidraTable;
import ghidra.util.task.Task; import ghidra.util.task.Task;
@ -75,7 +74,6 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
protected WizardManager wizardManager; protected WizardManager wizardManager;
public AbstractVTCorrelatorTest(String sourceProgLoc, String destProgLoc) { public AbstractVTCorrelatorTest(String sourceProgLoc, String destProgLoc) {
super();
this.sourceProgLoc = sourceProgLoc; this.sourceProgLoc = sourceProgLoc;
this.destProgLoc = destProgLoc; this.destProgLoc = destProgLoc;
} }
@ -132,16 +130,14 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
// Check the summary panel. // Check the summary panel.
checkWizardButtonEnablement(true, false, true, true); checkWizardButtonEnablement(true, false, true, true);
String labelString = "<html>" + "Operation:<br>" + "Session Name:<br>" + String labelString = "Operation:<br>" + "Session Name:<br>" + "Source Program:<br>" +
"Source Program:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" + "Destination Program:<br>" + "Program Correlator:<br>" +
"Exclude Accepted Matches:<br>" + "Source Address Set:<br>" + "Exclude Accepted Matches:<br>" + "Source Address Set:<br>" +
"Destination Address Set:<br>" + "</html>"; "Destination Address Set:<br>" + "</html>";
String summaryString = "<html>" + "Add to Version Tracking Session<br>" + String summaryString = "Add to Version Tracking Session<br>" + session.getName() + "<br>" +
session.getName() + "<br>" + srcProg.getName() + "<br>" + destProg.getName() + "<br>" + srcProg.getName() + "<br>" + destProg.getName() + "<br>" + correlatorName + "<br>" +
correlatorName + "<br>" + "No<br>" + "Entire Source Program<br>" + "No<br>" + "Entire Source Program<br>" + "Entire Destination Program<br>" + "</html>";
"Entire Destination Program<br>" + "</html>"; checkSummaryPanel(labelString, summaryString, wizardManager::finish);
checkSummaryPanel(HTMLUtilities.toHTML(labelString), HTMLUtilities.toHTML(summaryString),
wizardManager::finish);
} }
public void runTestCorrelator(String correlatorName) { public void runTestCorrelator(String correlatorName) {
@ -377,7 +373,7 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
/** /**
* Run Dummy Task Monitor, flush events and wait for Swing. * Run Dummy Task Monitor, flush events and wait for Swing.
* @param task * @param task
* @throws Exception * @throws Exception
*/ */
protected void runTask(Task task) throws Exception { protected void runTask(Task task) throws Exception {
@ -462,33 +458,32 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
OptionsEditorPanel correlatorOptionsPanel = getCorrelatorOptionsPanel(correlatorName); OptionsEditorPanel correlatorOptionsPanel = getCorrelatorOptionsPanel(correlatorName);
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<EditorState> editorInfoList = List<EditorState> editorInfoList = (List<EditorState>) TestUtils
(List<EditorState>) TestUtils.getInstanceField("editorInfoList", .getInstanceField("editorInfoList", correlatorOptionsPanel);
correlatorOptionsPanel);
for (EditorState editorState : editorInfoList) { for (EditorState editorState : editorInfoList) {
String optionName = editorState.getTitle(); String optionName = editorState.getTitle();
Component editorComponent = editorState.getEditorComponent(); Component editorComponent = editorState.getEditorComponent();
if (optionName.equals( if (optionName
VTAbstractReferenceProgramCorrelatorFactory.CONFIDENCE_THRESHOLD)) { .equals(VTAbstractReferenceProgramCorrelatorFactory.CONFIDENCE_THRESHOLD)) {
PropertyText fieldText = (PropertyText) editorComponent; PropertyText fieldText = (PropertyText) editorComponent;
fieldText.setText(String.format("%f", confidence)); fieldText.setText(String.format("%f", confidence));
fieldText.repaint(); fieldText.repaint();
} }
else if (optionName.equals( else if (optionName
VTAbstractReferenceProgramCorrelatorFactory.MEMORY_MODEL)) { .equals(VTAbstractReferenceProgramCorrelatorFactory.MEMORY_MODEL)) {
PropertySelector selector = (PropertySelector) editorComponent; PropertySelector selector = (PropertySelector) editorComponent;
selector.setSelectedItem(memoryModel); selector.setSelectedItem(memoryModel);
selector.repaint(); selector.repaint();
} }
else if (optionName.equals( else if (optionName
VTAbstractReferenceProgramCorrelatorFactory.SIMILARITY_THRESHOLD)) { .equals(VTAbstractReferenceProgramCorrelatorFactory.SIMILARITY_THRESHOLD)) {
PropertyText fieldText = (PropertyText) editorComponent; PropertyText fieldText = (PropertyText) editorComponent;
fieldText.setText(String.format("%f", score)); fieldText.setText(String.format("%f", score));
fieldText.repaint(); fieldText.repaint();
} }
else if (optionName.equals( else if (optionName
VTAbstractReferenceProgramCorrelatorFactory.REFINE_RESULTS)) { .equals(VTAbstractReferenceProgramCorrelatorFactory.REFINE_RESULTS)) {
PropertyBoolean checkBox = (PropertyBoolean) editorComponent; PropertyBoolean checkBox = (PropertyBoolean) editorComponent;
checkBox.setSelected(refineResults); checkBox.setSelected(refineResults);
checkBox.repaint(); checkBox.repaint();
@ -537,9 +532,8 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel); (JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
assertNotNull(excludeCheckbox); assertNotNull(excludeCheckbox);
JCheckBox showAddressSetPanelsCheckbox = JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox", .getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
addressSetOptionsPanel);
assertNotNull(showAddressSetPanelsCheckbox); assertNotNull(showAddressSetPanelsCheckbox);
assertEquals("Exclude Accepted Matches checkbox", excludeAccepted, assertEquals("Exclude Accepted Matches checkbox", excludeAccepted,
@ -561,9 +555,8 @@ public abstract class AbstractVTCorrelatorTest extends AbstractGhidraHeadedInteg
(JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel); (JCheckBox) TestUtils.getInstanceField("excludeCheckbox", addressSetOptionsPanel);
assertNotNull(excludeCheckbox); assertNotNull(excludeCheckbox);
JCheckBox showAddressSetPanelsCheckbox = JCheckBox showAddressSetPanelsCheckbox = (JCheckBox) TestUtils
(JCheckBox) TestUtils.getInstanceField("showAddressSetPanelsCheckbox", .getInstanceField("showAddressSetPanelsCheckbox", addressSetOptionsPanel);
addressSetOptionsPanel);
assertNotNull(showAddressSetPanelsCheckbox); assertNotNull(showAddressSetPanelsCheckbox);
if (excludeCheckbox.isSelected() != excludeAccepted) { if (excludeCheckbox.isSelected() != excludeAccepted) {