Package java.beans

Examples of java.beans.PropertyChangeSupport.removePropertyChangeListener()


        sup.addPropertyChangeListener(l1);

        PropertyChangeListener[] listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        sup.removePropertyChangeListener(l1);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
        sup.addPropertyChangeListener(l3);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
View Full Code Here


        assertEquals(0, prop.getPropertyChangeListeners().length);

        prop.addPropertyChangeListener(lis2);
        assertEquals(1, prop.getPropertyChangeListeners().length);

        prop.removePropertyChangeListener("name", lis1);
        assertEquals(0, prop.getPropertyChangeListeners().length);
    }

    /**
     * @tests java.beans.PropertyChangeSupport#removePropertyChangeListener(
View Full Code Here

        pcs.addPropertyChangeListener("property", listener);
        PropertyChangeListener[] listeners = pcs.getPropertyChangeListeners();
        assertEquals(1, listeners.length);

        pcs.removePropertyChangeListener(listeners[0]);
        listeners = pcs.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
    }

    /**
 
View Full Code Here

        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

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.