Package com.volantis.mcs.interaction.impl

Examples of com.volantis.mcs.interaction.impl.ListProxyImpl


                .returns(itemClassDescriptorMock)
                .any();
    }

    protected InternalProxy createProxy() {
        return new ListProxyImpl(proxyModelDescriptorMock,
                listClassDescriptorMock);
    }
View Full Code Here


        // =====================================================================
        //   Create Test Objects
        // =====================================================================

        final ListProxyImpl listProxy = (ListProxyImpl) createProxy(parentProxyMock);
        listProxy.addListener(listenerMock, false);

        // =====================================================================
        //   Set Test Object Specific Expectations
        // =====================================================================

        addExpectationsForAddItemProxy(listProxy, itemProxyMock);

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        checkModificationCountIncremented(
                listProxy, new Modifier() {
                    public void modify() {
                        Proxy itemProxy = listProxy.addItemProxy();
                        assertEquals("Item Proxy", itemProxyMock, itemProxy);
                    }
                });
    }
View Full Code Here

        // =====================================================================
        //   Create Test Objects
        // =====================================================================

        final ListProxyImpl listProxy = (ListProxyImpl) createProxy(parentProxyMock);
        listProxy.addListener(listenerMock, false);

        // =====================================================================
        //   Set Expectations
        // =====================================================================

        addExpectationsForAddItemProxy(listProxy, itemProxyMock);

        parentProxyMock.expects.isReadOnly().returns(false);

        // The item should be detached from the list.
        itemProxyMock.expects.detach();

        // Should cause an event to be sent to listeners on the object.
        RemovedFromListEvent event =
                new RemovedFromListEvent(listProxy, 0, 0, true);
        listenerMock.expects.removedFromList(event);

        // Should also cause an event to be sent to the parent proxy.
        parentProxyMock.expects.fireEvent(event);

        // Parent should supply the underlying model object.
        parentProxyMock.expects.getEmbeddedModelObject(listProxy, false)
                .returns(MODEL_LIST).any();

        // =====================================================================
        //   Test Expectations
        // =====================================================================

        final Proxy itemProxy = listProxy.addItemProxy();
        assertEquals("Item Proxy", itemProxyMock, itemProxy);

        checkModificationCountIncremented(
                listProxy, new Modifier() {
                    public void modify() {
                        listProxy.removeItemProxy(itemProxy);
                    }
                });
    }
View Full Code Here

        // The proxy for the Contacts class.
        BeanProxy contactsProxy = (BeanProxy)
                model.createProxyForType(contactsDescriptor);

        // The proxy for the list of Person objects in the Contacts class.
        ListProxyImpl listProxy = (ListProxyImpl)
                contactsProxy.getPropertyProxy(Contacts.CONTACTS);

        // The proxies for two instances of Person objects in the list.
        BeanProxy person1Proxy = (BeanProxy) listProxy.addItemProxy();
        BeanProxy person2Proxy = (BeanProxy) listProxy.addItemProxy();

        // The proxy for the address of the first Person object.
        BeanProxy address1Proxy = (BeanProxy) person1Proxy.getPropertyProxy(
                Person.ADDRESS);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.interaction.impl.ListProxyImpl

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.