FileDocCategorySizeDatePackage
ObserverTest.javaAPI DocAndroid 1.5 API2093Wed May 06 22:41:04 BST 2009org.apache.harmony.luni.tests.java.util

ObserverTest

public class ObserverTest extends TestCase

Fields Summary
Constructors Summary
Methods Summary
public voidtestUpdate()

        TestObservable observable = new TestObservable();
        Mock_Observer observer = null;
        observable.addObserver(observer = new Mock_Observer());
        observable.notifyObservers();
        assertEquals("Notified when unchnaged", 0, observer.getUpdateCount());
        observable.doChange();
        observable.notifyObservers();
        assertEquals("Failed to notify", 1, observer.getUpdateCount());