Bug 342998 Refactor ESelectionService into multiple classes
While there is a master/slave relationship "enforced" by the current implementation, it is non-obvious as the code is quite convoluted. The implementation needs to be refactored to enhance readability.
tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/application/ESelectionServiceTest.java
.get(ESelectionService.class.getName());
		ESelectionService windowService = (ESelectionService) windowContext
				.get(ESelectionService.class.getName());
		EPartService partService = (EPartService) windowContext
				.get(EPartService.class.getName());
		Object selectionA = new Object();
		Object selectionB = new Object();
		SelectionListener listener = new SelectionListener();
		windowService.addSelectionListener(listener);
		serviceA.setSelection(selectionA);
		assertEquals(partA, listener.getPart());
		assertEquals(selectionA, listener.getSelection());
		listener.reset();
		serviceA.setSelection(selectionA);
		assertNull(listener.getPart());
		assertNull(listener.getSelection());
		listener.reset();
		serviceB.setSelection(selectionB);
		assertNull(listener.getPart());
		assertNull(listener.getSelection());
		listener.reset();
		partService.activate(partB);
		assertEquals(partB, listener.getPart());
		assertEquals(selectionB, listener.getSelection());
		windowService.removeSelectionListener(listener);
		listener.reset();
		partService.activate(partA);
		assertNull(listener.getPart());
		assertNull(listener.getSelection());
		listener.reset();