Community
Participate
Working Groups
3.6. Oh Boy. The way the JUnit view gets its UI states is a mess! Some are stored in the settings, some are stored in the preferences and some use mementos. This results in different states of actions when doing e.g. close/reopen or after a restart. The biggest problem which we have to fix is that we loose the state for those actions that set their state via new InstanceScope().getNode(JUnitCorePlugin.CORE_PLUGIN_ID) because no one saves that node on shutdown. So, the simplest fix for 3.6.1 is to add the following line to JUnitCorePlugin.stop(BundleContext): new InstanceScope().getNode(JUnitCorePlugin.CORE_PLUGIN_ID).flush(); We could probably just sneak that into bug 317755. Another issue: why are the UI-only settings stored in the JUnit Core plug-in? I think we should move all that code to the UI and clean this up. Test Case: 1. start new workspace 2. open JUnit view 3. toggle 'Activate on Error/Failure Only' 4. exit 5. start ==> verify state
Created attachment 177214 [details] Fix for 3.6.1 In 3.5, the preferences were saved automatically because JUnitPlugin extends AbstractUIPlugin and AbstractUIPlugin#stop(..) saves all preferences. The fix implements Dani's suggestion and does the same in JUnitCorePlugin#stop(BundleContext). Dani, OK for 3.6.1? > Another issue: why are the UI-only settings stored in the JUnit Core plug-in? I > think we should move all that code to the UI and clean this up. During the JUnit plug-ins split, all preferences were moved to org.eclipse.jdt.junit.core. We could revert this for some of the preferences, but that would make the migration more complex. Wontfix for 3.6.1. IMO, also too much work for too little gain in HEAD.
>The fix implements Dani's suggestion and does the same in >JUnitCorePlugin#stop(BundleContext). Dani, OK for 3.6.1? +1 for 3.6.1 Moving the constants back to UI has less priority than cleaning up the different behavior of the action when it comes to restart and close/reopen.
Released to R3_6_maintenance (and earlier released into I20100824-0800).
Verified on Windows 7 using M20100825-0800.