Code example for PropertyChangeListenerProxy

0
        sup.addPropertyChangeListener("myProp", null);
 
        PropertyChangeListener[] listeners = sup.getPropertyChangeListeners();
        assertEquals(0, listeners.length);
 
        new PropertyChangeListenerProxy("myProp", null);
        assertEquals(0, listeners.length);
    } 
 
    /* 
     * Test the method addPropertyChangeListener(PropertyChangeListener, 
     * String) with a normal listener parameter and a null property name 
     * parameter. 
     */ 
    public void testAddPropertyChangeListener_PropertyChangeListener_String_NullProperty() { 
        Object src = new Object();
        PropertyChangeSupport sup = new PropertyChangeSupport(src);
        PropertyChangeListener l1 = new MockPropertyChangeListener();
        PropertyChangeListener l2 = new MockPropertyChangeListener();
        PropertyChangeListener l3 = new PropertyChangeListenerProxy("myProp",
                l2);