Bug 287536 [CommonNavigator] Wrong sorter unit tests
Build ID: Build id: I20090611-1540 Steps To Reproduce: Several tests in SorterTest rely on the dynamicAddModelObjects method. That method breaks the contract of viewer.add ("This method should be called (by the content provider) when a single * element has been added to the model") in that it calls viewer.add(newData) but doesn't actually add newData to the project. More information: The corresponding tests will fail if for example _viewer.add(parent, children) is implemented as _viewer.refresh(parent), which should not make any difference.
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/SorterTest.java
_contentService.bindExtensions(
				new String[] { TEST_CONTENT_SORTER_RESOURCE_SORTONLY }, false);
		_contentService.getActivationService().activateExtensions(
				new String[] { TEST_CONTENT_SORTER_RESOURCE_SORTONLY }, false);
		_viewer.expandAll();
		TreeItem[] items = _viewer.getTree().getItems();
		TreeItem[] childItems;
		
		
		
		assertEquals("p2", items[0].getText());
		assertEquals("p1", items[1].getText());
		assertEquals("Test", items[2].getText());
		assertEquals("Bluefile6.txt", items[0].getItems()[0].getText());
		assertEquals("f2", items[1].getItems()[0].getText());
		_contentService.getActivationService().deactivateExtensions(
				new String[] { TEST_CONTENT_SORTER_RESOURCE_SORTONLY }, false);
		
		refreshViewer();
		_viewer.expandAll();
		DisplayHelper.sleep(1000);
		
		items = _viewer.getTree().getItems();
		assertEquals("p2", items[1].getText());
		assertEquals("p1", items[0].getText());
		
		assertEquals("Test", items[2].getText());
		childItems = items[1].getItems();
		assertEquals("f1", childItems[0].getText());
		childItems = items[0].getItems();