Search in sources :

Example 21 with SetChangeEventTracker

use of org.eclipse.jface.databinding.conformance.util.SetChangeEventTracker in project eclipse.platform.ui by eclipse-platform.

the class JavaBeanObservableArrayBasedSetTest method testSetChangeEventFiresWhenNewSetIsSet.

@Test
public void testSetChangeEventFiresWhenNewSetIsSet() throws Exception {
    Bean[] elements = new Bean[] { new Bean(), new Bean() };
    SetChangeEventTracker listener = SetChangeEventTracker.observe(set);
    assertEquals(0, listener.count);
    bean.setArray(elements);
    assertEquals(1, listener.count);
}
Also used : SetChangeEventTracker(org.eclipse.jface.databinding.conformance.util.SetChangeEventTracker) Test(org.junit.Test) MutableObservableSetContractTest(org.eclipse.jface.databinding.conformance.MutableObservableSetContractTest)

Aggregations

SetChangeEventTracker (org.eclipse.jface.databinding.conformance.util.SetChangeEventTracker)21 Test (org.junit.Test)17 MutableObservableSetContractTest (org.eclipse.jface.databinding.conformance.MutableObservableSetContractTest)15 IObservableSet (org.eclipse.core.databinding.observable.set.IObservableSet)8 SetChangeEvent (org.eclipse.core.databinding.observable.set.SetChangeEvent)5 HashSet (java.util.HashSet)4 CurrentRealm (org.eclipse.jface.databinding.conformance.util.CurrentRealm)4 Collection (java.util.Collection)2 Set (java.util.Set)2 IObservableCollection (org.eclipse.core.databinding.observable.IObservableCollection)2 ObservableCollectionContractTest (org.eclipse.jface.databinding.conformance.ObservableCollectionContractTest)2 TestCollection (org.eclipse.jface.databinding.conformance.util.TestCollection)2 ArrayList (java.util.ArrayList)1 IObservablesListener (org.eclipse.core.databinding.observable.IObservablesListener)1 ChangeEventTracker (org.eclipse.jface.databinding.conformance.util.ChangeEventTracker)1 Before (org.junit.Before)1