Package org.apache.harmony.beans.tests.support.beancontext.mock

Examples of org.apache.harmony.beans.tests.support.beancontext.mock.MockBeanContextChild


        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


        support.addBeanContextMembershipListener(l1);
        support.addBeanContextMembershipListener(l2);

        l1.clearLastEvent();
        l2.clearLastEvent();
        Object child = new MockBeanContextChild();
        support.add(child);
        assertTrue(l1.lastEventAdd);
        assertMembershipEvent(l1.lastEvent, support, null, child);
        assertTrue(l2.lastEventAdd);
        assertMembershipEvent(l2.lastEvent, support, null, child);
View Full Code Here

    }

    public void testBcsChildren() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        support.add(new Integer(1));
        support.add(new MockBeanContextChild());

        Collection expectedChildren = support.children().values();
        Iterator it = support.publicBcsChildren();
        int count = 0;
        while (it.hasNext()) {
View Full Code Here

    public void testContains() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        Object c1 = "string value";
        Object c2 = new Integer(129);
        Object c3 = new MockBeanContextChild();
        support.add(c1);
        support.add(c2);
        support.add(c3);

        assertTrue(support.children().containsKey(c1));
View Full Code Here

    public void testContainsAll() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        Object c1 = "string value";
        Object c2 = new Integer(129);
        Object c3 = new MockBeanContextChild();
        support.add(c1);
        support.add(c2);
        support.add(c3);
        ArrayList<Object> l = new ArrayList<Object>();
        l.add(c1);
View Full Code Here

    public void testContainsKey() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        Object c1 = "string value";
        Object c2 = new Integer(129);
        Object c3 = new MockBeanContextChild();
        support.add(c1);
        support.add(c2);
        support.add(c3);

        assertTrue(support.children().containsKey(c1));
View Full Code Here

    public void testCopyChildren() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        Object c1 = "string value";
        Object c2 = new Integer(129);
        Object c3 = new MockBeanContextChild();
        support.add(c1);
        support.add(c2);
        support.add(c3);

        Object children[] = support.publicCopyChildren();
View Full Code Here

                .publicGetChildBeanContextChild(null);
        assertNull(result);
    }

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

        // Regression for HARMONY-1393
View Full Code Here

            // expected
        }
    }

    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

        assertSame(Locale.CHINA, support.getLocale());
    }

    public void testGetResource_NullParam() {
        MockBeanContextSupport support = new MockBeanContextSupport();
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);

        try {
            support.getResource(null, child);
            fail();
View Full Code Here

TOP

Related Classes of org.apache.harmony.beans.tests.support.beancontext.mock.MockBeanContextChild

Copyright © 2018 www.massapicom. 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.