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

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


        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);

        MockBeanContextServiceRevokedListener rl = new MockBeanContextServiceRevokedListener();
        Object service = support.getService(child, child, Collection.class,
                null, rl);
        assertSame(Collections.EMPTY_SET, service);
        assertNull(rl.lastEvent);
        support.records.clear();
View Full Code Here


        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(null, requestor, Collection.class, selector, l);
            fail();
        } catch (NullPointerException e) {
View Full Code Here

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

        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        Object requestor = "a requestor";
        Object selector = "a selector";
        MockBeanContextServiceRevokedListener l = new MockBeanContextServiceRevokedListener();

        Object result = support.getService(child, requestor, List.class,
                selector, l);
        assertNull(result);
    }
View Full Code Here

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

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

        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        childSupport.add(child);
        String requestor = "requestor";
        String selector = "selector";
        MockBeanContextServiceRevokedListener rl = new MockBeanContextServiceRevokedListener();
        Object service = childSupport.getService(child, requestor,
                Collection.class, selector, rl);
        assertNotNull(service);

        support.records.clear();
        childSupport.records.clear();
        provider.records.clear();
        l1.clearLastEvent();
        l2.clearLastEvent();

        support.revokeService(Collection.class, provider, false);
        assertEquals(0, support.services().size());

        support.records.assertEndOfRecords();
        childSupport.records.assertEndOfRecords();
        provider.records.assertEndOfRecords();
        assertSame(support, l1.lastRevokedEvent
                .getSourceAsBeanContextServices());
        assertSame(Collection.class, l1.lastRevokedEvent.getServiceClass());
        assertFalse(l1.lastRevokedEvent.isCurrentServiceInvalidNow());
        assertNull(l2.lastRevokedEvent);
        assertSame(childSupport, rl.lastEvent.getSourceAsBeanContextServices());
        assertSame(Collection.class, rl.lastEvent.getServiceClass());
        assertFalse(rl.lastEvent.isCurrentServiceInvalidNow());

        support.records.clear();
        childSupport.records.clear();
        provider.records.clear();
        l1.clearLastEvent();
        l2.clearLastEvent();
        rl.clearLastEvent();

        childSupport.releaseService(child, requestor, service);

        support.records.assertEndOfRecords();
        childSupport.records.assertEndOfRecords();
View Full Code Here

        childSupport.addService(Collection.class, provider);
        MockBeanContextServices child = new MockBeanContextServices();
        childSupport.add(child);
        String requestor = "requestor";
        String selector = "selector";
        MockBeanContextServiceRevokedListener rl = new MockBeanContextServiceRevokedListener();
        Object service = childSupport.getService(child, requestor,
                Collection.class, selector, rl);
        assertNotNull(service);

        support.records.clear();
View Full Code Here

        MockBeanContextChild child = new MockBeanContextChild();
        support.add(child);
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);

        MockBeanContextServiceRevokedListener rl = new MockBeanContextServiceRevokedListener();
        Object service = support.getService(child, child, Collection.class,
                null, rl);
        assertSame(Collections.EMPTY_SET, service);
        assertNull(rl.lastEvent);
        support.records.clear();
View Full Code Here

        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(null, requestor, Collection.class, selector, l);
            fail();
        } catch (NullPointerException e) {
View Full Code Here

TOP

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

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.