Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2009-01-05 18:49:33 +0000
committerChris Goldthorpe2009-01-05 18:49:33 +0000
commit6b5b4409a2858b78003b7698cc5adce7570651c8 (patch)
treebf8960b686bda5e547251345b490edb3fe84887f /org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc
parentbd75e3d8b323ed77e5de2cffca497cc01d5974b5 (diff)
downloadeclipse.platform.ua-6b5b4409a2858b78003b7698cc5adce7570651c8.tar.gz
eclipse.platform.ua-6b5b4409a2858b78003b7698cc5adce7570651c8.tar.xz
eclipse.platform.ua-6b5b4409a2858b78003b7698cc5adce7570651c8.zip
Clean up preference code in UA testsv20090105
Diffstat (limited to 'org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc')
-rw-r--r--org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java
index 93c2c8cbb..740a94b5a 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/toc/TocSortingTest.java
@@ -12,8 +12,12 @@ package org.eclipse.ua.tests.help.toc;
import java.util.List;
+import junit.framework.TestCase;
+
import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.help.IToc;
import org.eclipse.help.ITocContribution;
import org.eclipse.help.ITopic;
@@ -23,8 +27,6 @@ import org.eclipse.help.internal.HelpPlugin;
import org.eclipse.help.internal.toc.TocSorter;
import org.eclipse.help.internal.util.ProductPreferences;
-import junit.framework.TestCase;
-
public class TocSortingTest extends TestCase {
private static final String BASE_TOCS = "baseTOCS";
@@ -117,9 +119,10 @@ public class TocSortingTest extends TestCase {
}
protected void setUp() throws Exception {
- Preferences prefs = HelpPlugin.getDefault().getPluginPreferences();
- helpDataPreference = prefs.getString(HelpPlugin.HELP_DATA_KEY);
- baseTocsPreference = prefs.getString(BASE_TOCS);
+ helpDataPreference = Platform.getPreferencesService().getString
+ (HelpPlugin.HELP_DATA_KEY, HelpPlugin.HELP_DATA_KEY, "", null);
+ baseTocsPreference = Platform.getPreferencesService().getString
+ (HelpPlugin.HELP_DATA_KEY, BASE_TOCS, "", null);
HelpData.clearProductHelpData();
ProductPreferences.resetPrimaryTocOrdering();
setHelpData(EMPTY_XML);
@@ -134,13 +137,15 @@ public class TocSortingTest extends TestCase {
}
private void setHelpData(String value) {
- Preferences prefs = HelpPlugin.getDefault().getPluginPreferences();
- prefs.setValue(HelpPlugin.HELP_DATA_KEY, value);
+ InstanceScope instanceScope = new InstanceScope();
+ IEclipsePreferences prefs = instanceScope.getNode(HelpPlugin.PLUGIN_ID);
+ prefs.put(HelpPlugin.HELP_DATA_KEY, value);
}
private void setBaseTocs(String value) {
- Preferences prefs = HelpPlugin.getDefault().getPluginPreferences();
- prefs.setValue(BASE_TOCS, value);
+ InstanceScope instanceScope = new InstanceScope();
+ IEclipsePreferences prefs = instanceScope.getNode(HelpPlugin.PLUGIN_ID);
+ prefs.put(BASE_TOCS, value);
}
private String toString(ITocContribution[] tocs) {

Back to the top