Bug 299340 [CommonNavigator] Enable new CNF tests
Enable the contributed CNF tests, make minor test improvements.
tests/org.eclipse.ui.tests.navigator/src/org/eclipse/ui/tests/navigator/FirstClassM1Tests.java
/**
	 * Adaptable project children test: verifies that project children are
	 * visible in the project explorer even though the M1 provider has replaced
	 * IProjects with M1Projects, which adapt to IResource. This test fails in
	 * both Ganymede and Galileo because the resourceContent provider triggers
	 * for M1Project, then fails to provide any children. See Bug #285353
	 */
	public void testM1ProjectHasChildren() throws Exception {
		String[] EXTENSIONS = new String[] { COMMON_NAVIGATOR_RESOURCE_EXT,
				
				
				TEST_CONTENT_M12_M1_CONTENT_FIRST_CLASS,
				TEST_CONTENT_M12_M2_CONTENT };
		_contentService.bindExtensions(EXTENSIONS, false);
		_contentService.getActivationService().activateExtensions(EXTENSIONS,
				true);
		TreeItem[] rootItems = _viewer.getTree().getItems();
		TreeItem p1Item = rootItems[_p1Ind];
		assertEquals("P1 tree item should be an M1Project", M1Project.class,
				p1Item.getData().getClass());
		_expand(rootItems);
		TreeItem[] p1Children = p1Item.getItems();
		assertEquals("Project should have 3 children", 3, p1Children.length);
	}
	private void _expand(TreeItem[] items) {
		for (int i = 0; i < items.length; i++) {
			_viewer.setExpandedState(items[i].getData(), true);
		}
	}
}