Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristof Marti2004-08-12 09:59:19 +0000
committerChristof Marti2004-08-12 09:59:19 +0000
commitb37033caba5cf1104eed66abe0b241fb1f432874 (patch)
tree5daf69cc124d7dba23e356a7457abc0637973d2f /org.eclipse.ui.editors.tests/src
parent502de85fe7e223d48f047b4e8f7f337e1544bfd7 (diff)
downloadeclipse.platform.text-b37033caba5cf1104eed66abe0b241fb1f432874.tar.gz
eclipse.platform.text-b37033caba5cf1104eed66abe0b241fb1f432874.tar.xz
eclipse.platform.text-b37033caba5cf1104eed66abe0b241fb1f432874.zip
add test for case where old value cannot be determined (not supported by current implementation)
Diffstat (limited to 'org.eclipse.ui.editors.tests/src')
-rw-r--r--org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/ChainedPreferenceStoreTest.java23
1 files changed, 21 insertions, 2 deletions
diff --git a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/ChainedPreferenceStoreTest.java b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/ChainedPreferenceStoreTest.java
index 8525e05cf..6bb49056e 100644
--- a/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/ChainedPreferenceStoreTest.java
+++ b/org.eclipse.ui.editors.tests/src/org/eclipse/ui/editors/tests/ChainedPreferenceStoreTest.java
@@ -23,7 +23,6 @@ import org.eclipse.jface.preference.PreferenceStore;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.ui.texteditor.AbstractDecoratedTextEditorPreferenceConstants;
import org.eclipse.ui.texteditor.ChainedPreferenceStore;
public class ChainedPreferenceStoreTest extends TestCase {
@@ -38,7 +37,7 @@ public class ChainedPreferenceStoreTest extends TestCase {
private List fEvents= new ArrayList();
private PropertyChangeListener fPropertyChangeListener= new PropertyChangeListener();
- private static final String PROPERTY= AbstractDecoratedTextEditorPreferenceConstants.EDITOR_TAB_WIDTH;
+ private static final String PROPERTY= "some.property";
private static final String VALUE= "8";
private static final String DEFAULT_VALUE= "4";
private static final String DEFAULT_DEFAULT_VALUE= "";
@@ -131,4 +130,24 @@ public class ChainedPreferenceStoreTest extends TestCase {
assertEquals(null, event.getOldValue());
assertEquals(DEFAULT_VALUE, event.getNewValue());
}
+
+// /**
+// * Case where the old value cannot be determined. (Not handled by the current implementation.)
+// */
+// public void testChainedStore4() {
+// IPreferenceStore store1= EditorsUI.getPreferenceStore();
+// IPreferenceStore store2= new PreferenceStore();
+// IPreferenceStore chainedStore= new ChainedPreferenceStore(new IPreferenceStore[] { store1, store2 });
+// store2.setDefault(PROPERTY, DEFAULT_VALUE);
+//
+// chainedStore.addPropertyChangeListener(fPropertyChangeListener);
+// store1.setValue(PROPERTY, VALUE);
+// chainedStore.removePropertyChangeListener(fPropertyChangeListener);
+//
+// assertEquals(1, fEvents.size());
+// PropertyChangeEvent event= (PropertyChangeEvent) fEvents.get(0);
+// assertEquals(PROPERTY, event.getProperty());
+// assertNull(event.getOldValue());
+// assertEquals(VALUE, event.getNewValue());
+// }
}

Back to the top