use of org.eclipse.jface.databinding.conformance.util.CurrentRealm in project eclipse.platform.ui by eclipse-platform.
the class PojoObservablesTest method testObservableValueWithRealm_ReturnsIBeanObservable.
@Test
public void testObservableValueWithRealm_ReturnsIBeanObservable() throws Exception {
CurrentRealm realm = new CurrentRealm(true);
IObservableValue value = PojoObservables.observeValue(realm, pojo, propertyName);
assertNotNull(value);
assertTrue(value instanceof IBeanObservable);
}
use of org.eclipse.jface.databinding.conformance.util.CurrentRealm in project eclipse.platform.ui by eclipse-platform.
the class AbstractObservableTest method testFireStaleRealmChecks.
@Test
public void testFireStaleRealmChecks() throws Exception {
RealmTester.setDefault(new CurrentRealm(true));
RealmTester.exerciseCurrent(() -> {
observable = new ObservableStub();
observable.fireStale();
});
}
use of org.eclipse.jface.databinding.conformance.util.CurrentRealm in project eclipse.platform.ui by eclipse-platform.
the class ObservableTrackerTest method testGetterCalled_ObservableRealmNotCurrent.
@Test
public void testGetterCalled_ObservableRealmNotCurrent() throws Exception {
try {
IObservable observable = new ObservableStub(new CurrentRealm(false));
ObservableTracker.getterCalled(observable);
fail("expected AssertionFailedException");
} catch (AssertionFailedException expected) {
}
}
use of org.eclipse.jface.databinding.conformance.util.CurrentRealm in project eclipse.platform.ui by eclipse-platform.
the class WritableListTest method testListConstructorsDoNotCopy_2.
@Test
public void testListConstructorsDoNotCopy_2() {
List<String> list = new ArrayList<>(Arrays.asList("a", "b", "c"));
WritableList<String> wlist = new WritableList<>(new CurrentRealm(true), list, Object.class);
wlist.remove(1);
assertEquals(2, list.size());
list.add("d");
assertEquals(3, wlist.size());
}
use of org.eclipse.jface.databinding.conformance.util.CurrentRealm in project eclipse.platform.ui by eclipse-platform.
the class WritableListTest method testListConstructorsDoNotCopy_1.
@Test
public void testListConstructorsDoNotCopy_1() {
RealmTester.setDefault(new CurrentRealm(true));
List<String> list = new ArrayList<>(Arrays.asList("a", "b", "c"));
WritableList<String> wlist = new WritableList<>(list, Object.class);
wlist.remove(1);
assertEquals(2, list.size());
list.add("d");
assertEquals(3, wlist.size());
}
Aggregations