Package java.beans

Examples of java.beans.PropertyChangeSupport.removePropertyChangeListener()


        listeners = sup.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
        sup.addPropertyChangeListener(l3);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        sup.removePropertyChangeListener(l3);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
        sup.addPropertyChangeListener("myProp3", l2);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
View Full Code Here


        listeners = sup.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
        sup.addPropertyChangeListener("myProp3", l2);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        sup.removePropertyChangeListener(l2);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        sup.removePropertyChangeListener(listeners[0]);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
View Full Code Here

        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        sup.removePropertyChangeListener(l2);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        sup.removePropertyChangeListener(listeners[0]);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
    }

    /*
 
View Full Code Here

     */
    public void testRemovePropertyChangeListener_PropertyChangeListener_Null() {
        Object src = new Object();
        PropertyChangeSupport sup = new PropertyChangeSupport(src);

        sup.removePropertyChangeListener(null);
        assertEquals(0, sup.getPropertyChangeListeners().length);
        sup.addPropertyChangeListener(null);
        assertEquals(0, sup.getPropertyChangeListeners().length);
        sup.removePropertyChangeListener(null);
        assertEquals(0, sup.getPropertyChangeListeners().length);
View Full Code Here

        sup.removePropertyChangeListener(null);
        assertEquals(0, sup.getPropertyChangeListeners().length);
        sup.addPropertyChangeListener(null);
        assertEquals(0, sup.getPropertyChangeListeners().length);
        sup.removePropertyChangeListener(null);
        assertEquals(0, sup.getPropertyChangeListeners().length);
    }

    /*
     * Test the method removePropertyChangeListener(PropertyChangeListener)
View Full Code Here

     * with a non-registered listener parameter.
     */
    public void testRemovePropertyChangeListener_PropertyChangeListener_NonRegistered() {
        Object src = new Object();
        PropertyChangeSupport sup = new PropertyChangeSupport(src);
        sup.removePropertyChangeListener(new MockPropertyChangeListener());
        assertEquals(0, sup.getPropertyChangeListeners().length);
    }

    /*
     * Test the method removePropertyChangeListener(PropertyChangeListener,
View Full Code Here

        MockPropertyChangeListener l1 = new MockPropertyChangeListener(src,
                "myProp", oldValue, newValue);

        sup.addPropertyChangeListener(l1);

        sup.removePropertyChangeListener("myProp", l1);
        assertEquals(1, sup.getPropertyChangeListeners().length);
        assertEquals(0, sup.getPropertyChangeListeners("myProp").length);
        sup.firePropertyChange("myProp", oldValue, newValue);
        l1.assertCalled();
    }
View Full Code Here

        PropertyChangeSupport sup = new PropertyChangeSupport(src);
        PropertyChangeListener l1 = new MockPropertyChangeListener();
        sup.addPropertyChangeListener("myProp", l1);
        assertEquals(1, sup.getPropertyChangeListeners().length);

        sup.removePropertyChangeListener("myProp", l1);
        assertEquals(0, sup.getPropertyChangeListeners().length);
        assertEquals(0, sup.getPropertyChangeListeners("myProp").length);

        PropertyChangeListener l2 = new MockPropertyChangeListener();
        PropertyChangeListener l3 = new PropertyChangeListenerProxy("myProp",
View Full Code Here

        PropertyChangeListener l2 = new MockPropertyChangeListener();
        PropertyChangeListener l3 = new PropertyChangeListenerProxy("myProp",
                l2);
        sup.addPropertyChangeListener(l3);
        assertEquals(1, sup.getPropertyChangeListeners().length);
        sup.removePropertyChangeListener("myProp", l2);
        assertEquals(0, sup.getPropertyChangeListeners().length);
        assertEquals(0, sup.getPropertyChangeListeners("myProp").length);
    }

    /*
 
View Full Code Here

     * String) with a non-registered listener parameter.
     */
    public void testRemovePropertyChangeListener_PropertyChangeListener_String_NonRegistered() {
        Object src = new Object();
        PropertyChangeSupport sup = new PropertyChangeSupport(src);
        sup.removePropertyChangeListener("myProp",
                new MockPropertyChangeListener());
        assertEquals(0, sup.getPropertyChangeListeners().length);
    }

    /*
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.