diff options
| author | Sergey Prigogin | 2017-01-26 21:29:48 +0000 |
|---|---|---|
| committer | Sergey Prigogin | 2017-01-27 17:41:10 +0000 |
| commit | ad0e8c85475d4df04dd3aa0068923cfac2ad3e87 (patch) | |
| tree | 5d482f9ba13f0964159649f67feb7ac48d5cc555 | |
| parent | a87b9bbb054c952bc49851f15ea115223211a157 (diff) | |
| download | eclipse.platform.runtime-ad0e8c85475d4df04dd3aa0068923cfac2ad3e87.tar.gz eclipse.platform.runtime-ad0e8c85475d4df04dd3aa0068923cfac2ad3e87.tar.xz eclipse.platform.runtime-ad0e8c85475d4df04dd3aa0068923cfac2ad3e87.zip | |
Bug 511138 - Some preference customizations are ignored
Revert "Bug 387898 - Wrong preference node created when starting org.eclipse.jdt.debug.ui plugin - test"
The the test is reverted because it would fail when the invalid change it depends upon is reverted.
This reverts commit 9f2e003e61774d56adf1716c8c0faa293240c19a.
Change-Id: I25708fe44e56f98851eb7edde43110b50c31a72a
3 files changed, 0 insertions, 88 deletions
diff --git a/tests/org.eclipse.core.tests.runtime/Plugin_Testing/preferences/bug387898/META-INF/MANIFEST.MF b/tests/org.eclipse.core.tests.runtime/Plugin_Testing/preferences/bug387898/META-INF/MANIFEST.MF deleted file mode 100644 index 13a0815ea..000000000 --- a/tests/org.eclipse.core.tests.runtime/Plugin_Testing/preferences/bug387898/META-INF/MANIFEST.MF +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: bug387898 -Bundle-SymbolicName: bug387898 -Bundle-Version: 1.0.0 diff --git a/tests/org.eclipse.core.tests.runtime/Plugin_Testing/preferences/bug387898/preferences.ini b/tests/org.eclipse.core.tests.runtime/Plugin_Testing/preferences/bug387898/preferences.ini deleted file mode 100644 index 96e8848e9..000000000 --- a/tests/org.eclipse.core.tests.runtime/Plugin_Testing/preferences/bug387898/preferences.ini +++ /dev/null @@ -1 +0,0 @@ -SomeBundlePreference=HelloBundle
diff --git a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/PreferencesServiceTest.java b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/PreferencesServiceTest.java index 8c3c1348e..81fb31401 100644 --- a/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/PreferencesServiceTest.java +++ b/tests/org.eclipse.core.tests.runtime/src/org/eclipse/core/tests/internal/preferences/PreferencesServiceTest.java @@ -12,18 +12,14 @@ package org.eclipse.core.tests.internal.preferences; import java.io.*; -import java.net.MalformedURLException; import java.util.*; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.core.internal.preferences.EclipsePreferences; import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.preferences.*; -import org.eclipse.core.tests.harness.BundleTestingHelper; import org.eclipse.core.tests.runtime.RuntimeTest; import org.eclipse.core.tests.runtime.RuntimeTestsPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleException; import org.osgi.service.prefs.BackingStoreException; import org.osgi.service.prefs.Preferences; @@ -724,17 +720,6 @@ public class PreferencesServiceTest extends RuntimeTest { assertEquals("1.0", TestInitializer.DEFAULT_PREF_VALUE, value); } - /** - * Tests a default preference value set in bundle's preferences.ini file. - */ - public void testDefaultFromBundleDefaults() throws MalformedURLException, BundleException, IOException { - Bundle bundle = BundleTestingHelper.installBundle("bug387898", RuntimeTestsPlugin.getContext(), RuntimeTestsPlugin.TEST_FILES_ROOT + "preferences/bug387898"); - BundleTestingHelper.refreshPackages(RuntimeTestsPlugin.getContext(), new Bundle[] {bundle}); - - String value = Platform.getPreferencesService().getString("bug387898", "SomeBundlePreference", null, null); - assertEquals("1.0", "HelloBundle", value); - } - /* * - exporting default values shouldn't do anything */ @@ -1241,71 +1226,4 @@ public class PreferencesServiceTest extends RuntimeTest { public void testApplyWithTransfers() { // todo } - - private void assertNodeDoesNotExist(String node) { - IPreferencesService service = Platform.getPreferencesService(); - Preferences root = service.getRootNode(); - String[] order = service.getLookupOrder("", null); - for (int i = 0; i < order.length; i++) { - try { - assertFalse("Node \"" + node + "\" exists in \"" + order[i] + "\" scope", root.node(order[i]).nodeExists(node)); - } catch (BackingStoreException e) { - fail(e.getMessage(), e); - } - } - } - - private void verifyNode(IScopeContext[] contexts, String qualifier, String key, String node) { - IPreferencesService service = Platform.getPreferencesService(); - - service.getBoolean(qualifier, key, false, contexts); - assertNodeDoesNotExist(node); - - service.getByteArray(qualifier, key, null, contexts); - assertNodeDoesNotExist(node); - - service.getDouble(qualifier, key, 0.0, contexts); - assertNodeDoesNotExist(node); - - service.getFloat(qualifier, key, 0.0f, contexts); - assertNodeDoesNotExist(node); - - service.getInt(qualifier, key, 0, contexts); - assertNodeDoesNotExist(node); - - service.getLong(qualifier, key, 0, contexts); - assertNodeDoesNotExist(node); - - service.getString(qualifier, key, null, contexts); - assertNodeDoesNotExist(node); - } - - private void doTestBug387898(IScopeContext[] contexts) { - String qualifier = getUniqueString(); - String key = "node//key"; - - // If we use contexts, then qualifier node may be created because - // internally it uses context.getNode(qualifier) method which may - // create a node. Perform verification only when no contexts are used. - if (contexts == null) - verifyNode(contexts, qualifier, key, qualifier); - - // Create qualifier node for each scope to verify nodes are not created out of the key. - IPreferencesService service = Platform.getPreferencesService(); - String[] order = service.getLookupOrder("", null); - Preferences root = service.getRootNode(); - for (int i = 0; i < order.length; i++) - root.node(order[i]).node(qualifier); - - // Child node of qualifier node should never be created from key. - verifyNode(contexts, qualifier, key, qualifier + "/node"); - } - - public void testBug387898WithoutContexts() { - doTestBug387898(null); - } - - public void testBug387898WithContexts() { - doTestBug387898(new IScopeContext[] {InstanceScope.INSTANCE, ConfigurationScope.INSTANCE, DefaultScope.INSTANCE}); - } } |
