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

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


        assertTrue(support.isDesignTime());
    }

    public void testChildJustRemovedHook() throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);

        MockBeanContextServiceRevokedListener rl = new MockBeanContextServiceRevokedListener();
View Full Code Here


    public void testGetService_NullParam() throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServiceRevokedListener l = new MockBeanContextServiceRevokedListener();
View Full Code Here

    public void testGetService_NonChild() throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServiceRevokedListener l = new MockBeanContextServiceRevokedListener();

        try {
            support.getService(new MockBeanContextChild(), requestor,
                    Collection.class, selector, l);
            fail();
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here

    public void testGetService_NoService() throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServiceRevokedListener l = new MockBeanContextServiceRevokedListener();
View Full Code Here

    public void testGetService_ThisContext() throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServicesListener l = new MockBeanContextServicesListener();
        support.records.clear();
View Full Code Here

        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        childSupport.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServicesListener l = new MockBeanContextServicesListener();
        support.records.clear();
View Full Code Here

        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        childSupport.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServicesListener l = new MockBeanContextServicesListener();
        support.records.clear();
View Full Code Here

    public void testReleaseService_NullParam() throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServicesListener l = new MockBeanContextServicesListener();
        support.records.clear();
View Full Code Here

    public void testReleaseService_WrongChildOrRequestor()
            throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServiceRevokedListener l = new MockBeanContextServiceRevokedListener();
        support.records.clear();

        Object service = support.getService(child, requestor, Collection.class,
                selector, l);
        assertSame(Collections.EMPTY_SET, service);
        provider.records.assertRecord("getService", support, requestor,
                Collection.class, selector, service);
        provider.records.assertEndOfRecords();
        support.records.assertEndOfRecords();

        try {
            support.releaseService(new MockBeanContextChild(), requestor,
                    service);
            fail();
        } catch (IllegalArgumentException e) {
            // expected
        }
View Full Code Here

    public void testReleaseService_WrongService()
            throws TooManyListenersException {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServiceRevokedListener l = new MockBeanContextServiceRevokedListener();
        support.records.clear();
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.