Bug 334644 Cannot manually un/render a window that's directly under the application
Setting the 'toBeRendered' flag for a window that's a direct child of an application does nothing. The workaround is to manually de/construct it via the IPresentationEngine.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java
application.setContext(appContext);
		appContext.set(MApplication.class.getName(), application);
		wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		assertNotNull(part.getObject());
		assertNotNull(part.getContext());
		SampleView view = (SampleView) part.getObject();
		view.errorOnWidgetDisposal = true;
		part.setToBeRendered(false);
		assertTrue("The view should have been destroyed", view.isDestroyed());
		assertNull(part.getObject());
		assertNull(part.getContext());
	}
	public void testBug331795_2() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);
		application.setSelectedElement(window);
		MPart part = BasicFactoryImpl.eINSTANCE.createPart();
		part.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");
		window.getChildren().add(part);
		window.setSelectedElement(part);
		application.setContext(appContext);
		appContext.set(MApplication.class.getName(), application);
		wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		assertNotNull(part.getObject());
		assertNotNull(part.getContext());
		SampleView view = (SampleView) part.getObject();