Bug 329079 CCE thrown when trying to render a window with a part that's not visible
java.lang.ClassCastException: org.eclipse.swt.layout.FillLayout at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.childRendered(WBWRenderer.java:521) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:502) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:554) at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:58) at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:456) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:490) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:554)
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java
MPart partC = BasicFactoryImpl.eINSTANCE.createPart();
		partC.setElementId("partC");
		partC.setContributionURI("platform:/plugin/org.eclipse.e4.ui.tests/org.eclipse.e4.ui.tests.workbench.SampleView");
		container.getChildren().add(partA);
		container.getChildren().add(partB);
		container.getChildren().add(partC);
		wb = new E4Workbench(application, appContext);
		wb.createAndRunUI(window);
		
		
		container.setSelectedElement(partA);
		partB.setToBeRendered(false);
		assertTrue(
				"Changing the TBR of a non-selected element should not change the value of the container's seletedElement",
				container.getSelectedElement() == partA);
		
		
		container.setSelectedElement(partA);
		partA.setToBeRendered(false);
		assertTrue(
				"Changing the TBR of the selected element should have set the field to null",
				container.getSelectedElement() == null);
	}
	public void testSelectedElementNullingParentChange() {
		MApplication application = ApplicationFactoryImpl.eINSTANCE
				.createApplication();
		application.setContext(appContext);
		appContext.set(MApplication.class.getName(), application);
		MWindow window = BasicFactoryImpl.eINSTANCE.createWindow();
		application.getChildren().add(window);