Examples of BeanContextChild


Examples of java.beans.beancontext.BeanContextChild

    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();
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

    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());
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.serviceRevoked(null);
    }

    public void testSetBeanContext() throws PropertyVetoException {
        BeanContextChild peer = new MockBeanContextChild();
        MockBeanContextChildSupport support = new MockBeanContextChildSupport(
                peer);
        MockPropertyChangeListener l1 = new MockPropertyChangeListener();
        MockVetoableChangeListener l2 = new MockVetoableChangeListener();
        support.addPropertyChangeListener("beanContext", l1);
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

        MockVetoableChangeListener l3 = new MockVetoableChangeListener();
        support.addBeanContextMembershipListener(l1);
        support.addPropertyChangeListener("children", l2);
        support.addVetoableChangeListener("children", l3);

        BeanContextChild child = new MockBeanContextChild();
        support.add(child);
        support.records.assertRecord("initialize", null);
        support.records.assertRecord("validatePendingAdd", child, Boolean.TRUE);
        support.records.assertRecord("createBCSChild", child, null, support
                .children().get(child));
        support.records.assertRecord("childJustAddedHook", child, support
                .children().get(child), null);
        support.records.assertEndOfRecords();
        assertTrue(l1.lastEventAdd);
        assertMembershipEvent(l1.lastEvent, support, null, child);
        assertNull(l2.lastEvent);
        assertNull(l3.lastEvent);

        assertSame(support, child.getBeanContext());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

        MockVetoableChangeListener l3 = new MockVetoableChangeListener();
        support.addBeanContextMembershipListener(l1);
        support.addPropertyChangeListener("children", l2);
        support.addVetoableChangeListener("children", l3);

        BeanContextChild childPeer = new MockBeanContextChild();
        BeanContextProxy child = new MockBeanContextProxy(childPeer);
        support.add(child);
        support.records.assertRecord("initialize", null);
        support.records.assertRecord("validatePendingAdd", child, Boolean.TRUE);
        support.records.assertRecord("createBCSChild", child, childPeer,
                support.children().get(child));
        support.records.assertRecord("createBCSChild", childPeer, child,
                support.children().get(childPeer));
        support.records.assertRecord("childJustAddedHook", child, support
                .children().get(child), null);
        support.records.assertRecord("childJustAddedHook", childPeer, support
                .children().get(childPeer), null);
        support.records.assertEndOfRecords();
        assertTrue(l1.lastEventAdd);
        assertMembershipEvent(l1.lastEvent, support, null, Arrays
                .asList(new Object[] { child, childPeer }));
        assertNull(l2.lastEvent);
        assertNull(l3.lastEvent);

        assertSame(support, childPeer.getBeanContext());
        assertEquals(2, support.size());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

        support.addBeanContextMembershipListener(l1);
        support.addPropertyChangeListener("children", l2);
        support.addVetoableChangeListener("children", l3);

        support.vetoAddRemove = true;
        BeanContextChild child = new MockBeanContextChild();
        try {
            support.add(child);
            fail();
        } catch (IllegalStateException e) {
            // expected
        }
        support.records.assertRecord("initialize", null);
        support.records
                .assertRecord("validatePendingAdd", child, Boolean.FALSE);
        support.records.assertEndOfRecords();
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);
        assertNull(l3.lastEvent);

        assertNull(child.getBeanContext());
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

    public void testGetBeanContextPeer() {
        // covered by testConstructor
    }

    public void testGetChildBeanContextChild_NullParam() {
        BeanContextChild result = MockBeanContextSupport
                .publicGetChildBeanContextChild(null);
        assertNull(result);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

        assertNull(result);
    }

    public void testGetChildBeanContextChild_BeanContextChild() {
        MockBeanContextChild child = new MockBeanContextChild();
        BeanContextChild result = MockBeanContextSupport
                .publicGetChildBeanContextChild(child);
        assertSame(child, result);

        // Regression for HARMONY-1393
        class TestBeanException extends BeanContextChildSupport implements
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

    }

    public void testGetChildBeanContextChild_BeanContextProxy() {
        MockBeanContextChild child = new MockBeanContextChild();
        MockBeanContextProxy proxy = new MockBeanContextProxy(child);
        BeanContextChild result = MockBeanContextSupport
                .publicGetChildBeanContextChild(proxy);
        assertSame(child, result);
    }
View Full Code Here

Examples of java.beans.beancontext.BeanContextChild

        assertSame(child, result);
    }

    public void testGetChildBeanContextChild_Neither() {
        Integer child = new Integer(129);
        BeanContextChild result = MockBeanContextSupport
                .publicGetChildBeanContextChild(child);
        assertNull(result);
    }
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.