Examples of BeanContextChildSupport


Examples of java.beans.beancontext.BeanContextChildSupport

     * Class under test for void
     * BeanContextChildSupport(java.beans.beancontext.BeanContextChild)
     */
    public void testBeanContextChildSupportBeanContextChild() {
        BeanContextChild c = new MockBeanContextChild();
        BeanContextChildSupport support = new MockBeanContextChildSupport(c);
        assertSame(c, support.getBeanContextChildPeer());
        assertSame(c, support.beanContextChildPeer);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertSame(c, support.getBeanContextChildPeer());
        assertSame(c, support.beanContextChildPeer);
    }

    public void testFirePropertyChange_NullParam() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.firePropertyChange(null, "a", "b");
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.firePropertyChange(null, "a", "b");
    }

    public void testFirePropertyChange() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockPropertyChangeListener l2 = new MockPropertyChangeListener();
        String propName = "property name";
        Object oldValue = new Integer(1);
        Object newValue = new Integer(5);

        support.addPropertyChangeListener(propName, l1);
        support.addPropertyChangeListener("xxx", l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertSame(oldValue, l1.lastEvent.getOldValue());
        assertSame(newValue, l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);
    }

    public void testFirePropertyChange_OldEqualsNew() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockPropertyChangeListener l2 = new MockPropertyChangeListener();
        String propName = "property name";
        Object oldValue = new Integer(1);
        Object newValue = new Integer(1);

        support.addPropertyChangeListener(propName, l1);
        support.addPropertyChangeListener("xxx", l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);
    }

    public void testFirePropertyChange_OldEqualsNew_IsNull() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockPropertyChangeListener l2 = new MockPropertyChangeListener();
        String propName = "property name";
        Object oldValue = null;
        Object newValue = null;

        support.addPropertyChangeListener(propName, l1);
        support.addPropertyChangeListener("xxx", l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertNull(l1.lastEvent.getOldValue());
        assertNull(l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);
    }

    public void testFireVetoableChange_NullParam() throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.fireVetoableChange(null, "a", "b");
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.fireVetoableChange(null, "a", "b");
    }

    public void testFireVetoableChange() throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockVetoableChangeListener l1 = new MockVetoableChangeListener();
        MockVetoableChangeListener l2 = new MockVetoableChangeListener();
        String propName = "property name";
        Object oldValue = new Integer(1);
        Object newValue = new Integer(5);

        support.addVetoableChangeListener(propName, l1);
        support.addVetoableChangeListener("xxx", l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertSame(oldValue, l1.lastEvent.getOldValue());
        assertSame(newValue, l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);
    }

    public void testFireVetoableChange_Vetoed() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockVetoableChangeListener l1 = new MockVetoableChangeListener();
        MockVetoableChangeListener l2 = new MockVetoableChangeListener();
        MockVetoChangeListener l3 = new MockVetoChangeListener();
        String propName = "property name";
        Object oldValue = new Integer(1);
        Object newValue = new Integer(5);

        support.addVetoableChangeListener(propName, l1);
        support.addVetoableChangeListener(propName, l2);
        support.addVetoableChangeListener(propName, l3);
        l1.clearLastEvent();
        l2.clearLastEvent();
        l3.clearLastEvent();
        try {
            support.fireVetoableChange(propName, oldValue, newValue);
            fail();
        } catch (PropertyVetoException e) {
            // expected
        }
        assertEquals(propName, l1.lastEvent.getPropertyName());
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertSame(support, l3.lastEvent.getSource());
    }

    public void testFireVetoableChange_OldEqualsNew()
            throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockVetoableChangeListener l1 = new MockVetoableChangeListener();
        MockVetoableChangeListener l2 = new MockVetoableChangeListener();
        String propName = "property name";
        Object oldValue = new Integer(1);
        Object newValue = new Integer(1);

        support.addVetoableChangeListener(propName, l1);
        support.addVetoableChangeListener("xxx", l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertNull(l2.lastEvent);
    }

    public void testFireVetoableChange_OldEqualsNew_IsNull()
            throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockVetoableChangeListener l1 = new MockVetoableChangeListener();
        MockVetoableChangeListener l2 = new MockVetoableChangeListener();
        String propName = "property name";
        Object oldValue = null;
        Object newValue = null;

        support.addVetoableChangeListener(propName, l1);
        support.addVetoableChangeListener("xxx", l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertNull(l1.lastEvent.getOldValue());
        assertNull(l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertNull(l2.lastEvent);
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.