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
new String[] { TEST_CONTENT_SORTER_MODEL }, false);
		_contentService.getActivationService().activateExtensions(
				new String[] { TEST_CONTENT_SORTER_MODEL }, false);
		dynamicAddModelObjects();
		TreeItem[] items = _viewer.getTree().getItems();
		TreeItem addedParent = items[_projectInd].getItem(0);
		assertEquals("BlueAddedParent", addedParent.getText());
		
		
		assertEquals("BlueAddedChild1", addedParent.getItem(0).getText());
		assertEquals("BlueChild1", addedParent.getItem(1).getText());
		assertEquals("BlueAddedFile1.txt", addedParent.getItem(2).getText());
		assertEquals("BlueAddedFile2.txt", addedParent.getItem(3).getText());
	}
	public void testSorterContentAddOverride() throws Exception {
		waitForModelObjects();
		_contentService.bindExtensions(
				new String[] { TEST_CONTENT_SORTER_MODEL_OVERRIDE }, false);
		_contentService.getActivationService().activateExtensions(
				new String[] { TEST_CONTENT_SORTER_MODEL_OVERRIDE }, false);
		dynamicAddModelObjects();
		TreeItem[] items = _viewer.getTree().getItems();
		TreeItem addedParent;
		
		addedParent = items[_projectInd].getItem(1);
		assertEquals("BlueParent", addedParent.getText());
		addedParent = items[_projectInd].getItem(0);
		assertEquals("BlueAddedParent", addedParent.getText());