Examples of BeanContextChildSupport


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

        // Regression for HARMONY-1393
        class TestBeanException extends BeanContextChildSupport implements
                BeanContextProxy {
            private static final long serialVersionUID = -8544245159647566063L;
            private final BeanContextChildSupport childSupport = new BeanContextChildSupport();

            public BeanContextChild getBeanContextProxy() {
                return childSupport;
            }
        }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

        // Regression for HARMONY-1393
        class TestBeanException extends BeanContextChildSupport implements
                BeanContextProxy {
            private static final long serialVersionUID = -8544245159647566063L;
            private final BeanContextChildSupport childSupport = new BeanContextChildSupport();

            public BeanContextChild getBeanContextProxy() {
                return childSupport;
            }
        }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport

    }

    public void testSize() {
        @SuppressWarnings("serial")
        class TestBean extends Component implements BeanContextProxy {
            public BeanContextChildSupport childSupport = new BeanContextChildSupport();

            public BeanContextChild getBeanContextProxy() {
                return childSupport;
            }
        }
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
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.