Bug 263207 [CommonNavigator] Improve DnD tracing and add DnD test suite
There are no DnD tests for the Common Navigator. Also, the CNF has many test utility classes (basically stolen from JDT), these should be moved into a lower level area, and it looks like org.eclipse.ui.test.harness is a good place. (Perhaps we can get the JDT to use these identical versions as well so there is only one copy that everyone uses). Finally, the DnD tracing needs to be improved to show more information and show it more concisely.
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/ProgrammaticOpenTest.java
assertTrue(expectedChildren.contains(children[i].getData()));
		}
	}
	public void testNavigatorExtensionEnablement() throws Exception {
		assertEquals("There should be no visible extensions for the programmatic viewer.", 0, contentService.getVisibleExtensionIds().length);
		contentService.bindExtensions(new String[] { COMMON_NAVIGATOR_RESOURCE_EXT }, false);
		assertEquals("There should be one visible extension for the programmatic viewer.", 1, contentService.getVisibleExtensionIds().length);
		contentService.getActivationService().activateExtensions(new String[] { COMMON_NAVIGATOR_RESOURCE_EXT }, true);
		contentService.getActivationService().activateExtensions(new String[] {}, true);
		refreshViewer();
		viewer.expandAll();
		TreeItem[] items = viewer.getTree().getItems();
		assertTrue("There should be NO items.", items.length == 0); 
		contentService.getActivationService().deactivateExtensions(new String[] {}, true);
		viewer.expandToLevel(2);
		items = viewer.getTree().getItems();
		assertTrue("There should be some items.", items.length > 0); 
	}
	public void testNavigatorSorterAccess() throws Exception {
		INavigatorSorterService sorterService = contentService.getSorterService();
		INavigatorContentDescriptor testDescriptor = contentService.getContentDescriptorById(COMMON_NAVIGATOR_TEST_EXT);
		Map sorters = sorterService.findAvailableSorters(testDescriptor);
		assertEquals(3, sorters.size());
		for (Iterator iter = sorters.entrySet().iterator(); iter.hasNext();) {
			Map.Entry entry = (Map.Entry) iter.next();
			assertTrue(entry.getValue() instanceof TestDataSorter);
		}
	}
}