use of org.eclipse.jface.preference.PreferenceStore in project eclipse.platform.text by eclipse.
the class ChainedPreferenceStoreTest method testChainedStore2.
/**
* Third case where the initial implementation used to have an assertion which would fail in this case
*/
@Test
public void testChainedStore2() {
IPreferenceStore store1 = new PreferenceStore();
IPreferenceStore store2 = new PreferenceStore();
IPreferenceStore chainedStore = new ChainedPreferenceStore(new IPreferenceStore[] { store1, store2 });
store1.setValue(PROPERTY, VALUE);
chainedStore.addPropertyChangeListener(fPropertyChangeListener);
// simulated change with newValue == null
store1.firePropertyChangeEvent(PROPERTY, DEFAULT_VALUE, null);
chainedStore.removePropertyChangeListener(fPropertyChangeListener);
assertEquals(1, fEvents.size());
PropertyChangeEvent event = fEvents.get(0);
assertEquals(store1, event.getSource());
assertEquals(PROPERTY, event.getProperty());
assertEquals(DEFAULT_VALUE, event.getOldValue());
assertEquals(null, event.getNewValue());
}
Aggregations