Search in sources :

Example 1 with AbstractObservable

use of org.eclipse.core.databinding.observable.AbstractObservable in project eclipse.platform.ui by eclipse-platform.

the class CompositeMapTest method hasListeners.

boolean hasListeners(AbstractObservable o) {
    try {
        Method method = AbstractObservable.class.getSuperclass().getDeclaredMethod("hasListeners", new Class[0]);
        method.setAccessible(true);
        return ((Boolean) method.invoke(o)).booleanValue();
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}
Also used : AbstractObservable(org.eclipse.core.databinding.observable.AbstractObservable) Method(java.lang.reflect.Method)

Example 2 with AbstractObservable

use of org.eclipse.core.databinding.observable.AbstractObservable in project eclipse.platform.ui by eclipse-platform.

the class CompositeMapTest method testDispose.

@Test
public void testDispose() {
    SimplePerson person0 = new SimplePerson("p0", "a0", "c0", "s0");
    person0.getCart().setNumItems(13);
    persons.add(person0);
    assertTrue(hasListeners((AbstractObservable) first));
    composedMap.dispose();
    assertFalse(hasListeners((AbstractObservable) first));
}
Also used : AbstractObservable(org.eclipse.core.databinding.observable.AbstractObservable) SimplePerson(org.eclipse.jface.examples.databinding.model.SimplePerson) Test(org.junit.Test)

Aggregations

AbstractObservable (org.eclipse.core.databinding.observable.AbstractObservable)2 Method (java.lang.reflect.Method)1 SimplePerson (org.eclipse.jface.examples.databinding.model.SimplePerson)1 Test (org.junit.Test)1