diff options
author | John Arthorne | 2009-02-28 20:46:03 +0000 |
---|---|---|
committer | John Arthorne | 2009-02-28 20:46:03 +0000 |
commit | f04b1c249d960061012faa27a3a8f8ccdbb6d747 (patch) | |
tree | 3a23d8ebe6265dfb0be3bc5f65e0f2b24bdfb549 /bundles/org.eclipse.equinox.p2.tests | |
parent | 6cea02b8d4d6d7826ea4d0e15bda17a881ce43c8 (diff) | |
download | rt.equinox.p2-f04b1c249d960061012faa27a3a8f8ccdbb6d747.tar.gz rt.equinox.p2-f04b1c249d960061012faa27a3a8f8ccdbb6d747.tar.xz rt.equinox.p2-f04b1c249d960061012faa27a3a8f8ccdbb6d747.zip |
Bug 266205 IllegalStateException while saving preferences
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.tests')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfilePreferencesTest.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfilePreferencesTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfilePreferencesTest.java index 4b12ae09a..6f9c50874 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfilePreferencesTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/engine/ProfilePreferencesTest.java @@ -10,8 +10,10 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.engine; +import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.preferences.IPreferencesService; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.engine.ProfilePreferences; import org.eclipse.equinox.p2.tests.AbstractProvisioningTest; import org.eclipse.equinox.p2.tests.TestActivator; import org.osgi.service.prefs.BackingStoreException; @@ -58,13 +60,26 @@ public class ProfilePreferencesTest extends AbstractProvisioningTest { } catch (BackingStoreException e) { fail("Unable to write to preferences: " + e.getMessage()); } + waitForSave(); try { pref.parent().removeNode(); } catch (BackingStoreException e) { // } + waitForSave(); pref = prefServ.getRootNode().node("/profile/_SELF_/testing"); - assertTrue("Value not present after load", value.equals(pref.get(key, null))); + assertEquals("Value not present after load", value, pref.get(key, null)); + } + + /** + * Wait for preferences to be flushed to disk + */ + private void waitForSave() { + try { + Job.getJobManager().join(ProfilePreferences.PROFILE_SAVE_JOB_FAMILY, null); + } catch (InterruptedException e) { + fail("4.99", e); + } } } |