Project: Eclipse_Platform_UI
Bug 114813 [DynamicUI] Incorrect synchronization will lead to JUnit failure (org.eclipse.ui.tests.dynamicplugins.DynamicPluginsTestSuite)
Reported: 2005-11-02 13:55:44 | Status: verified fixed

The DynamicTestCase (org.eclipse.ui.tests.dynamicplugins) provides synchronization on the registry events that is not quite correct. To ensure that all registry events for the bundles added or removed have been processed, it adds a registry listener in the doSetUp() and waits for the listener to be called assuming that it is going to be the last listener in the chain. This work most of the time, however, in some instances (i.e. ObjectContributionTest.testViewerContributions()) new registry listeners are added between the doSetUp() and the getBundle() calls. Such listeners would fall outside of the synchronization mechanism and JUnit (s) will fail. The simple solution is to do addition of the synchronization registry listener at the begining of the getBundle() / removeBundle() and remove that listener before returning from those methods.

Files changed in fix:
tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dynamicplugins/DynamicTestCase.java