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

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


        }
    }

    public void testAddBeanContextServicesListener() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();

        support.addBeanContextServicesListener(l1);
        assertEquals(1, support.bcsListeners().size());
        assertTrue(support.bcsListeners().contains(l1));
    }
View Full Code Here


     */
    public void testAddServiceClassBeanContextServiceProvider_ParentContext() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

View Full Code Here

     */
    public void testAddServiceClassBeanContextServiceProvider_ChildContext() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

View Full Code Here

     */
    public void testAddServiceClassBeanContextServiceProvider_Exist() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        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);
        support.records.assertRecord("createBCSSServiceProvider",
                Collection.class, provider, bcssProvider);
        support.records.assertEndOfRecords();
        BeanContextServiceAvailableEvent evt = (BeanContextServiceAvailableEvent) childSupport.records
                .getArg(0);
        childSupport.records.assertRecord("serviceAvailable", evt, null);
        assertSame(support, evt.getSourceAsBeanContextServices());
        assertSame(Collection.class, evt.getServiceClass());
        childSupport.records.assertEndOfRecords();
        assertSame(support, l1.lastAvailableEvent
                .getSourceAsBeanContextServices());
        assertSame(Collection.class, l1.lastAvailableEvent.getServiceClass());
        assertSame(support, l2.lastAvailableEvent
                .getSourceAsBeanContextServices());
        assertSame(Collection.class, l2.lastAvailableEvent.getServiceClass());
        l1.clearLastEvent();
        l2.clearLastEvent();

        // add exist
        MockBeanContextServiceProvider another = new MockBeanContextServiceProvider();
        result = support.addService(Collection.class, another);
        assertFalse(result);
View Full Code Here

     */
    public void testAddServiceClassBeanContextServiceProviderboolean_FalseParam() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

View Full Code Here

     */
    public void testFireServiceAddedBeanContextServiceAvailableEvent() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

View Full Code Here

     */
    public void testFireServiceAddedClass() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

View Full Code Here

     */
    public void testFireServiceRevokedBeanContextServiceRevokedEvent() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

View Full Code Here

     */
    public void testFireServiceRevokedClassboolean() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesSupport childSupport = new MockBeanContextServicesSupport();
        support.add(childSupport);
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        MockBeanContextServicesListener l2 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        childSupport.addBeanContextServicesListener(l2);
        support.records.assertRecord("initialize", null);
        childSupport.records.assertRecord("initialize", null);

View Full Code Here

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

    public void testGetChildBeanContextServicesListener_Is() {
        MockBeanContextServicesListener l = new MockBeanContextServicesListener();
        BeanContextServicesListener result = MockBeanContextServicesSupport
                .publicGetChildBeanContextServicesListener(l);
        assertSame(l, result);
    }
View Full Code Here

TOP

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

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.