@Test
	public void testRenameDataTypeWithSameNameAsCategory() throws Exception {
		// select a category
		expandNode(programNode);
		String miscNodeName = "MISC";
		final CategoryNode miscNode = (CategoryNode) programNode.getChild(miscNodeName);
		assertNotNull(miscNode);
		StructureDataType struct = new StructureDataType("MISC", 0);
		struct.add(new DWordDataType());
		builder.addDataType(struct);
		waitForTree();
		DataType resolved = program.getDataTypeManager().resolve(struct, null);
		DataTypeNode node = programNode.getNode(resolved);
		selectNode(node);

		final DockingActionIf action = getAction(plugin, "Rename");
		assertTrue(action.isEnabledForContext(treeContext));

		// select "Rename" action
		final String newDatatypeName = "ItWorked";
		DataTypeTestUtils.performAction(action, tree);
		waitForTree();
		runSwing(() -> {
			int rowForPath = jTree.getRowForPath(miscNode.getTreePath());

			DefaultTreeCellEditor cellEditor = (DefaultTreeCellEditor) tree.getCellEditor();
			Container container = (Container) cellEditor.getTreeCellEditorComponent(jTree, miscNode,
				true, true, true, rowForPath);
			JTextField textField = (JTextField) container.getComponent(0);

			textField.setText(newDatatypeName);
			jTree.stopEditing();
		});
		waitForProgram();
		waitForTree();

		assertEquals("ItWorked", resolved.getName());
	}
Tests for managing categories through the data manager plugin and tests for
actions being enabled when a node is selected.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/datamgr/DataTypeManagerPluginTest.java