Examples of BeanContextChildSupport


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

Examples of java.beans.beancontext.BeanContextChildSupport

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

    public void testGetBeanContext() throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockBeanContext mockBeanContext = new MockBeanContext();
        assertNull(support.getBeanContext());
        support.setBeanContext(mockBeanContext);
        assertSame(mockBeanContext, support.getBeanContext());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        support.setBeanContext(mockBeanContext);
        assertSame(mockBeanContext, support.getBeanContext());
    }

    public void testGetBeanContextChildPeer() throws Exception {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        assertSame(support, support.beanContextChildPeer);
        assertSame(support, support.getBeanContextChildPeer());

        BeanContextChild mockChild = new MockBeanContextChild();
        support = new MockBeanContextChildSupport(mockChild);
        assertSame(mockChild, support.beanContextChildPeer);
        assertSame(mockChild, support.getBeanContextChildPeer());

        BeanContextChildSupport sup = new BeanContextChildSupport();

        assertEquals(sup, sup.getBeanContextChildPeer());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertNull(support.lastInitBeanContext);
        assertSame(ctx2, support.lastReleaseBeanContext);
    }

    public void testIsDelegated() throws Exception {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        assertFalse(support.isDelegated());

        BeanContextChild mockChild = new MockBeanContextChild();
        support = new MockBeanContextChildSupport(mockChild);
        assertTrue(support.isDelegated());

        support.beanContextChildPeer = support;
        assertFalse(support.isDelegated());

        BeanContextChildSupport sup = new BeanContextChildSupport();

        assertFalse("Child is not supposed to be delegated", sup.isDelegated());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        assertNull(support.lastInitBeanContext);
        assertSame(ctx2, support.lastReleaseBeanContext);
    }

    public void testRemovePropertyChangeListener_NullParam() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.removePropertyChangeListener("property name", null);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.removePropertyChangeListener("property name", null);
    }

    public void testRemovePropertyChangeListener() {
        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(propName, 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());
        assertEquals(propName, l2.lastEvent.getPropertyName());
        assertSame(oldValue, l2.lastEvent.getOldValue());
        assertSame(newValue, l2.lastEvent.getNewValue());
        assertSame(support, l2.lastEvent.getSource());

        support.removePropertyChangeListener(propName, l1);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertEquals(propName, l2.lastEvent.getPropertyName());
        assertSame(oldValue, l2.lastEvent.getOldValue());
        assertSame(newValue, l2.lastEvent.getNewValue());
        assertSame(support, l2.lastEvent.getSource());

        support.removePropertyChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);

        // remove not-registered listener
        support.removePropertyChangeListener(propName, l1);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        // remove not-registered listener
        support.removePropertyChangeListener(propName, l1);
    }

    public void testRemoveVetoableChangeListener_NullParam() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.removeVetoableChangeListener("property name", null);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        support.removeVetoableChangeListener(propName, l1);
    }

    public void testServiceAvailable() {
        // guess the impl is empty
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.serviceAvailable(null);

        // Regression for HARMONY-372
        (new java.beans.beancontext.BeanContextChildSupport())
                .serviceAvailable(null);
        (new java.beans.beancontext.BeanContextChildSupport())
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

                .serviceRevoked(null);
    }

    public void testServiceRevoked() {
        // guess the impl is empty
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.serviceRevoked(null);
    }
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.