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
* (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.e4.workbench.ui.IPresentationEngine#createGui(org.eclipse
	 * .e4.ui.model.application.MUIElement, java.lang.Object)
	 */
	public Object createGui(MUIElement element, Object parent) {
		if (!element.isToBeRendered()) {
			return null;
		}
		if (element instanceof MContext) {
			MContext mcontext = (MContext) element;
			if (mcontext.getContext() != null) {
				return null;
			}
			String contextName = element.getClass().getInterfaces()[0]
					.getName() + " eclipse context"; 
			final IEclipseContext parentContext = getParentContext(element);
			final IEclipseContext createdContext = (parentContext != null) ? parentContext
					.createChild(contextName) : EclipseContextFactory
					.create(contextName);
			populateModelInterfaces(mcontext, createdContext, element
					.getClass().getInterfaces());
			for (String variable : mcontext.getVariables()) {
				createdContext.declareModifiable(variable);
			}
			mcontext.setContext(createdContext);
			if (element instanceof MContribution && createContributions) {
				MContribution contribution = (MContribution) element;
				String uri = contribution.getContributionURI();