@Test
	public void testExportToolOverwriteCancel() throws Exception {
		// export using the menu action
		createTool();

		DockingActionIf exportAction = getAction("Untitled", "Export Tool");
		performAction(exportAction, "Untitled", false);
		GhidraFileChooser chooser = waitForDialogComponent(GhidraFileChooser.class);

		setSelectedFile(chooser, exportFile);
		pressButtonByText(chooser, "Export");
		waitForSwing();

		performAction(exportAction, "Untitled", false);

		chooser = waitForDialogComponent(GhidraFileChooser.class);
		setSelectedFile(chooser, exportFile);

		JButton b = findButtonByText(chooser, "Export");
		pressButton(b, false);
		OptionDialog optD = waitForDialogComponent(OptionDialog.class);
		assertNotNull(optD);
		assertEquals("Overwrite?", optD.getTitle());

		pressButtonByText(optD.getComponent(), "Cancel");
	}
Tests for tool actions on the front end (Ghidra project window)
Ghidra/Test/IntegrationTest/src/test.slow/java/ghidra/framework/main/ToolActionManagerTest.java