Bug 307901 EPartService does not short circuit saveAll(boolean) if 'false' and/or no save handler is provided
The code looks like so... boolean success = true; for (MPart dirtyPart : dirtyParts) { if (!savePart(dirtyPart, false)) { success = false; } } return success; ...the first time a save fails, we should return false immediately.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/EPartServiceTest.java
getEngine().createGui(window);
		EPartService partService = (EPartService) window.getContext().get(
				EPartService.class.getName());
		assertEquals(partFront, partService.getActivePart());
		PartListener partListener = new PartListener();
		partService.addPartListener(partListener);
		partService.activate(partBack);
		assertEquals(1, partListener.getHidden());
		assertEquals(partFront, partListener.getHiddenParts().get(0));
		assertTrue(partListener.isValid());
		partListener.clear();
		partService.activate(partFront);
		assertEquals(1, partListener.getHidden());
		assertEquals(partBack, partListener.getHiddenParts().get(0));
		assertTrue(partListener.isValid());
	}
	public void testEvent_PartHidden2() {
		MApplication application = MApplicationFactory.eINSTANCE
				.createApplication();
		MWindow windowA = MApplicationFactory.eINSTANCE.createWindow();
		MWindow windowB = MApplicationFactory.eINSTANCE.createWindow();
		application.getChildren().add(windowA);
		application.getChildren().add(windowB);
		application.setSelectedElement(windowA);
		MPartStack stack = MApplicationFactory.eINSTANCE.createPartStack();
		windowB.getChildren().add(stack);
		windowB.setSelectedElement(stack);
		MPart partA = MApplicationFactory.eINSTANCE.createPart();
		MPart partB = MApplicationFactory.eINSTANCE.createPart();
		stack.getChildren().add(partA);