diff --git a/Ghidra/Features/Base/src/main/java/ghidra/test/AbstractGhidraHeadlessIntegrationTest.java b/Ghidra/Features/Base/src/main/java/ghidra/test/AbstractGhidraHeadlessIntegrationTest.java index dff6866dee..5479ba2287 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/test/AbstractGhidraHeadlessIntegrationTest.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/test/AbstractGhidraHeadlessIntegrationTest.java @@ -39,6 +39,7 @@ import ghidra.framework.plugintool.mgr.ServiceManager; import ghidra.program.database.ProgramBuilder; import ghidra.program.database.ProgramDB; import ghidra.program.model.address.*; +import ghidra.program.model.data.DataTypeManager; import ghidra.program.model.lang.*; import ghidra.program.model.listing.Program; import ghidra.program.model.symbol.Namespace; @@ -206,25 +207,51 @@ public abstract class AbstractGhidraHeadlessIntegrationTest extends AbstractDock * Provides a convenient method for modifying the current program, handling the transaction * logic. * - * @param p the program + * @param dobj the domain object (e.g., a program) * @param c the code to execute * @see #modifyProgram(Program, ExceptionalCallback) * @see #modifyProgram(Program, ExceptionalFunction) */ - public static void tx(Program p, ExceptionalCallback c) { - int txId = p.startTransaction("Test - Function in Transaction"); + public static void tx(DomainObject dobj, ExceptionalCallback c) { + int txId = dobj.startTransaction("Test - Function in Transaction"); boolean commit = true; try { c.call(); - p.flushEvents(); + dobj.flushEvents(); waitForSwing(); } catch (Exception e) { commit = false; - failWithException("Exception modifying program '" + p.getName() + "'", e); + failWithException("Exception modifying program '" + dobj.getName() + "'", e); } finally { - p.endTransaction(txId, commit); + dobj.endTransaction(txId, commit); + } + } + + /** + * Provides a convenient method for modifying the given data type manager, handling the + * transaction logic. + * + * @param dtm the data type manager + * @param c the code to execute + * @see #modifyProgram(Program, ExceptionalCallback) + * @see #modifyProgram(Program, ExceptionalFunction) + */ + public static void tx(DataTypeManager dtm, ExceptionalCallback c) { + int txId = dtm.startTransaction("Test - Function in Transaction"); + boolean commit = true; + try { + c.call(); + dtm.flushEvents(); + waitForSwing(); + } + catch (Exception e) { + commit = false; + failWithException("Exception modifying program '" + dtm.getName() + "'", e); + } + finally { + dtm.endTransaction(txId, commit); } } @@ -261,7 +288,7 @@ public abstract class AbstractGhidraHeadlessIntegrationTest extends AbstractDock /** * Provides a convenient method for modifying the current program, handling the transaction - * logic. This method is calls {@link #tx(Program, ExceptionalCallback)}, but helps with + * logic. This method is calls {@link #tx(DomainObject, ExceptionalCallback)}, but helps with * semantics. * * @param p the program diff --git a/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/NewProjectWizardTest.java b/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/NewProjectWizardTest.java index 5bf7d47b49..0393287609 100644 --- a/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/NewProjectWizardTest.java +++ b/Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/NewProjectWizardTest.java @@ -28,7 +28,6 @@ import org.junit.experimental.categories.Category; import docking.action.DockingActionIf; import docking.wizard.WizardDialog; -import generic.test.AbstractGenericTest; import generic.test.category.PortSensitiveCategory; import ghidra.framework.GenericRunInfo; import ghidra.framework.client.*; @@ -313,7 +312,7 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest { assertNotNull(repNameField); assertTrue(!repNameField.isEnabled()); - JList repList = findComponent(repPanel, JList.class); + JList repList = findComponent(repPanel, JList.class); assertNotNull(repList); assertTrue(repList.isEnabled()); @@ -457,7 +456,7 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest { assertNotNull(repNameField); assertTrue(!repNameField.isEnabled()); - final JList repList = findComponent(repPanel, JList.class); + final JList repList = findComponent(repPanel, JList.class); assertNotNull(repList); assertTrue(repList.isEnabled()); @@ -471,7 +470,6 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest { SwingUtilities.invokeAndWait(() -> repList.setSelectedIndex(0)); waitForSwing(); assertTrue(nextButton.isEnabled()); - assertTrue(!finishButton.isEnabled()); // next panel is project location panel pressButton(nextButton, true); @@ -531,7 +529,7 @@ public class NewProjectWizardTest extends AbstractGhidraHeadedIntegrationTest { } private void startServer() throws Exception { - File parent = new File(AbstractGenericTest.getTestDirectoryPath()); + File parent = new File(getTestDirectoryPath()); // Create server instance serverRoot = new File(parent, "My_Server");