Bug 312333 Exceptions in JUnit's PartService
With the code from Head there are 3 NPEs in UIAllTests: testShowPart_Id_Unrendered_ACTIVATE testShowPart_Id_Unrendered_ACTIVATE2 testShowPart_Id_Unrendered_ACTIVATE3 They all seem to have the same cause: context of the activated part is null.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/HeadlessContextPresentationEngine.java
if (children.size() == 1) {
								stack.setSelectedElement((MPart) element);
							}
						}
					}
				}
			}
		};
		eventBroker.subscribe(UIEvents.buildTopic(
				UIEvents.ElementContainer.TOPIC,
				UIEvents.ElementContainer.CHILDREN), childHandler);
		activeChildHandler = new EventHandler() {
			public void handleEvent(Event event) {
				Object element = event
						.getProperty(UIEvents.EventTags.NEW_VALUE);
				if (element instanceof MUIElement) {
					Object parent = event
							.getProperty(UIEvents.EventTags.ELEMENT);
					createGui((MUIElement) element, parent);
				}
			}
		};
		eventBroker.subscribe(UIEvents.buildTopic(
				UIEvents.ElementContainer.TOPIC,
				UIEvents.ElementContainer.SELECTEDELEMENT), activeChildHandler);
	}
	public void setCreateContributions(boolean createContributions) {
		this.createContributions = createContributions;
	}
	/*