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

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


        provider.records.assertEndOfRecords();
    }

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


        assertNull(result);
    }

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

    public void testGetService_ParentContext() throws TooManyListenersException {
        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";
View Full Code Here

        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        assertFalse(childSupport.hasService(Collection.class));

        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        assertTrue(childSupport.hasService(Collection.class));
    }
View Full Code Here

    public void testHasService_ThisService() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        assertFalse(support.hasService(Collection.class));

        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        assertTrue(support.hasService(Collection.class));
    }
View Full Code Here

    public void testReleaseBeanContextResources()
            throws TooManyListenersException, PropertyVetoException {
        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";
View Full Code Here

        assertTrue(l.lastRevokedEvent.isCurrentServiceInvalidNow());
    }

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

     * Class under test for boolean addService(java.lang.Class,
     * java.beans.beancontext.BeanContextServiceProvider)
     */
    public void testAddServiceClassBeanContextServiceProvider_NullParam() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();

        try {
            support.addService(null, provider);
            fail();
        } catch (NullPointerException e) {
View Full Code Here

        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        boolean result = support.addService(Collection.class, provider);
        assertTrue(result);
        assertEquals(1, support.services().size());
        assertEquals(0, childSupport.services().size());
        Object bcssProvider = support.services().get(Collection.class);
View Full Code Here

        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        boolean result = childSupport.addService(Collection.class, provider);
        assertTrue(result);
        assertEquals(0, support.services().size());
        assertEquals(1, childSupport.services().size());
        Object bcssProvider = childSupport.services().get(Collection.class);
View Full Code Here

TOP

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

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.