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

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


    }

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

    public void testReleaseService() 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

        assertEquals(0, support.bcsListeners().size());
    }

    public void testRevokeService_NullParam() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);

        try {
            support.revokeService(null, provider, false);
            fail();
View Full Code Here

    public void testRevokeService_NonServiceClass() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        support.records.clear();
        provider.records.clear();

        support.revokeService(List.class, provider, false);
View Full Code Here

    public void testRevokeService_NonWrongProvider() {
        MockBeanContextServicesSupport support = new MockBeanContextServicesSupport();
        MockBeanContextServicesListener l1 = new MockBeanContextServicesListener();
        support.addBeanContextServicesListener(l1);
        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        support.records.clear();
        provider.records.clear();

        try {
            support.revokeService(Collection.class,
                    new MockBeanContextServiceProvider(), false);
            fail();
        } catch (IllegalArgumentException e) {
            // expected
        }
        assertNull(l1.lastRevokedEvent);
View Full Code Here

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

        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        support.addService(Collection.class, provider);
        MockBeanContextChild child = new MockBeanContextChild();
        childSupport.add(child);
        String requestor = "requestor";
        String selector = "selector";
View Full Code Here

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

        MockBeanContextServiceProvider provider = new MockBeanContextServiceProvider();
        childSupport.addService(Collection.class, provider);
        MockBeanContextServices child = new MockBeanContextServices();
        childSupport.add(child);
        String requestor = "requestor";
        String selector = "selector";
View Full Code Here

                .addBeanContextServicesListener(new MockBeanContextServicesListenerS(
                        "l3"));
        support
                .addBeanContextServicesListener(new MockBeanContextServicesListener());
        support.addService(Collection.class,
                new MockBeanContextServiceProvider());
        support.addService(List.class,
                new MockBeanContextServiceProviderS("p1"));
        support
                .addService(Set.class,
                        new MockBeanContextServiceProviderS("p2"));
        support.addService(Map.class, new MockBeanContextServiceProvider());

        assertEqualsSerially(support,
                (BeanContextServicesSupport) SerializationTester
                        .getDeserilizedObject(support));
    }
View Full Code Here

                 .addBeanContextServicesListener(new MockBeanContextServicesListenerS(
                         "l3"));
         support
                 .addBeanContextServicesListener(new MockBeanContextServicesListener());
         support.addService(Collection.class,
                 new MockBeanContextServiceProvider());
         support.addService(List.class,
                 new MockBeanContextServiceProviderS("p1"));
         support
                 .addService(Set.class,
                         new MockBeanContextServiceProviderS("p2"));
         support.addService(Map.class, new MockBeanContextServiceProvider());
         SerializationTest.verifyGolden(this, support, new SerializableAssert(){
             public void assertDeserialized(Serializable initial, Serializable deserialized) {
                 assertEqualsSerially((BeanContextServicesSupport) initial,
                         (BeanContextServicesSupport) deserialized);
             }
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.