Example usage for org.eclipse.jface.databinding.conformance.util CurrentRealm CurrentRealm

List of usage examples for org.eclipse.jface.databinding.conformance.util CurrentRealm CurrentRealm

Introduction

In this page you can find the example usage for org.eclipse.jface.databinding.conformance.util CurrentRealm CurrentRealm.

Prototype

public CurrentRealm(boolean current) 

Source Link

Usage

From source file:org.eclipse.core.tests.databinding.beans.PojoObservablesTest.java

License:Open Source License

public void testObservableValueWithRealm_ReturnsIBeanObservable() throws Exception {
    CurrentRealm realm = new CurrentRealm(true);
    IObservableValue value = PojoObservables.observeValue(realm, pojo, propertyName);

    assertNotNull(value);/* w  w w .j a v  a2 s .  c o m*/
    assertTrue(value instanceof IBeanObservable);
}

From source file:org.eclipse.core.tests.databinding.observable.AbstractObservableTest.java

License:Open Source License

public void testFireStaleRealmChecks() throws Exception {
    RealmTester.setDefault(new CurrentRealm(true));

    RealmTester.exerciseCurrent(new Runnable() {
        public void run() {
            observable = new ObservableStub();
            observable.fireStale();/*w ww.ja va2 s  .  c  o m*/
        }
    });
}

From source file:org.eclipse.core.tests.databinding.observable.AbstractObservableTest.java

License:Open Source License

public void testFireChangeRealmChecks() throws Exception {
    RealmTester.setDefault(new CurrentRealm(true));

    RealmTester.exerciseCurrent(new Runnable() {
        public void run() {
            observable = new ObservableStub();
            observable.fireChange();/*from  w ww  . j av a  2 s  . c om*/
        }
    });
}

From source file:org.eclipse.core.tests.databinding.observable.list.AbstractObservableListTest.java

License:Open Source License

protected void setUp() throws Exception {
    RealmTester.setDefault(new CurrentRealm(true));
    list = new AbstractObservableListStub();
}

From source file:org.eclipse.core.tests.databinding.observable.list.ObservableListTest.java

License:Open Source License

protected void setUp() throws Exception {
    RealmTester.setDefault(new CurrentRealm(true));

    list = new ObservableListStub(new ArrayList(0), Object.class);
}

From source file:org.eclipse.core.tests.databinding.observable.list.WritableListTest.java

License:Open Source License

public void testRemoveRealmChecks() throws Exception {
    RealmTester.setDefault(new CurrentRealm(true));
    final WritableList list = new WritableList();
    list.add("");
    list.add("");

    RealmTester.exerciseCurrent(new Runnable() {
        public void run() {
            list.remove("");
        }/*  w  w  w  .j av  a 2s .c  om*/
    });
    RealmTester.setDefault(null);
}

From source file:org.eclipse.core.tests.databinding.observable.list.WritableListTest.java

License:Open Source License

public void testRemoveByIndexRealmChecks() throws Exception {
    RealmTester.setDefault(new CurrentRealm(true));
    final WritableList list = new WritableList();
    list.add("");
    list.add("");

    RealmTester.exerciseCurrent(new Runnable() {
        public void run() {
            list.remove(list.size() - 1);
        }/*from  w  w  w .  j a  va 2  s  .c  o m*/
    });

    RealmTester.setDefault(null);
}

From source file:org.eclipse.core.tests.databinding.observable.list.WritableListTest.java

License:Open Source License

public void testListConstructorsDoNotCopy_1() {
    RealmTester.setDefault(new CurrentRealm(true));
    List list = new ArrayList(Arrays.asList(new Object[] { "a", "b", "c" }));
    WritableList wlist = new WritableList(list, Object.class);
    wlist.remove(1);//from  w  w  w .  j a v a  2  s . co  m
    assertEquals(2, list.size());
    list.add("d");
    assertEquals(3, wlist.size());
}

From source file:org.eclipse.core.tests.databinding.observable.list.WritableListTest.java

License:Open Source License

public void testListConstructorsDoNotCopy_2() {
    List list = new ArrayList(Arrays.asList(new Object[] { "a", "b", "c" }));
    WritableList wlist = new WritableList(new CurrentRealm(true), list, Object.class);
    wlist.remove(1);/*from w w  w . j av  a  2 s  .  com*/
    assertEquals(2, list.size());
    list.add("d");
    assertEquals(3, wlist.size());
}

From source file:org.eclipse.core.tests.databinding.observable.list.WritableListTest.java

License:Open Source License

public void testCollectionConstructorsCopy_1() {
    RealmTester.setDefault(new CurrentRealm(true));
    List list = new ArrayList(Arrays.asList(new Object[] { "a", "b", "c" }));
    WritableList wlist = new WritableList((Collection) list, Object.class);
    wlist.remove(1);/*from  ww w  . jav  a2s  . c om*/
    assertEquals(3, list.size());
    list.add("d");
    assertEquals(2, wlist.size());
}