Package java.beans.beancontext

Examples of java.beans.beancontext.BeanContextServiceRevokedEvent


    public void testServiceRevoked() {
        MockChildBeanContextServicesSupport mockChildBeanContextServicesSupport = new MockChildBeanContextServicesSupport();
        BeanContextServicesSupport beanContextServicesSupport = new BeanContextServicesSupport();
        beanContextServicesSupport.add(mockChildBeanContextServicesSupport);
        BeanContextServiceRevokedEvent beanContextServiceRevokedEvent = new BeanContextServiceRevokedEvent(new BeanContextServicesSupport(), Collection.class,false);
        beanContextServicesSupport.serviceRevoked(beanContextServiceRevokedEvent);
        assertTrue(mockChildBeanContextServicesSupport.revokeCalled);       
    }
View Full Code Here


    support.addBeanContextServicesListener(new MyListener());
    Class c = Object.class;

    support.addService(c, new MyProvider());

    BeanContextServiceRevokedEvent revokeEvent = new BeanContextServiceRevokedEvent(
        support, c, false);

    support.serviceRevoked(revokeEvent);
        assertEquals(0, serviceRevoked);
        assertEquals(2, serviceAvailable);
View Full Code Here

        assertFalse(event.isServiceClass(null));
    }

    public void testBeanContextServiceRevokedEvent() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
                services, BeanContext.class, true);
        assertSame(BeanContext.class, event.getServiceClass());
        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());
        assertTrue(event.isCurrentServiceInvalidNow());
    }
View Full Code Here

        assertTrue(event.isCurrentServiceInvalidNow());
    }

    public void testGetSourceAsBeanContextServices() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
                services, BeanContext.class, true);
        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());

        // Regression for HARMONY-1153
        BeanContextServicesSupport sup = new BeanContextServicesSupport(
                new MockBeanContextServices(), new Locale("ru", "RU"), false,
                false);
        event = new BeanContextServiceRevokedEvent(sup,
                MockBeanContextServices.class, false);
        assertNotNull(event.getSourceAsBeanContextServices());

        // Regression for HARMONY-2506
        BeanContextServiceRevokedEvent obj = new BeanContextServiceRevokedEvent(
                new testBeanContextServices(), Integer.class, true);

        obj.setPropagatedFrom(new testBeanContext());
        assertNotNull(obj.getSourceAsBeanContextServices());
    }
View Full Code Here

        }
    }

    public void testGetServiceClass() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
                services, BeanContext.class, true);
        assertSame(BeanContext.class, event.getServiceClass());
    }
View Full Code Here

        assertSame(BeanContext.class, event.getServiceClass());
    }

    public void testIsServiceClass() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
                services, BeanContext.class, true);
        assertTrue(event.isServiceClass(BeanContext.class));
        assertFalse(event.isServiceClass(Integer.class));

        // Regression for HARMONY-1516
        assertFalse(event.isServiceClass(null));
    }
View Full Code Here

        assertFalse(event.isServiceClass(null));
    }

    public void testIsCurrentServiceInvalidNow() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
                services, BeanContext.class, true);
        assertTrue(event.isCurrentServiceInvalidNow());
        event = new MockBeanContextServiceRevokedEvent(services,
                BeanContext.class, false);
        assertFalse(event.isCurrentServiceInvalidNow());
    }
View Full Code Here

                BeanContext.class, false);
        assertFalse(event.isCurrentServiceInvalidNow());
    }

    public void testSerialization() throws IOException, ClassNotFoundException {
        BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
                new MockBeanContextServices(), ArrayList.class, true);
        event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));

        assertEqualsSerially(event,
                (BeanContextServiceRevokedEvent) SerializationTester
                        .getDeserilizedObject(event));
View Full Code Here

                        .getDeserilizedObject(event));

    }

    public void testSerialization_Compatibility() throws Exception {
        BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
                new MockBeanContextServices(), ArrayList.class, true);
        event.setPropagatedFrom(new MockBeanContextDelegateS("from ID"));
        SerializationTest.verifyGolden(this, event, new SerializableAssert() {
            public void assertDeserialized(Serializable orig, Serializable ser) {
                assertEqualsSerially((BeanContextServiceRevokedEvent) orig,
                        (BeanContextServiceRevokedEvent) ser);
            }
View Full Code Here

        });
    }

    public void testConstructor() throws Exception {
        BeanContextServices bcs = new MockBeanContextServices();
        BeanContextServiceRevokedEvent event = new BeanContextServiceRevokedEvent(
                bcs, ArrayList.class, true);
        assertEquals(null, event.getPropagatedFrom());
        assertEquals(ArrayList.class, event.getServiceClass());
        assertSame(bcs, event.getSource());
        assertSame(bcs, event.getBeanContext());
        assertSame(bcs, event.getSourceAsBeanContextServices());
        assertFalse(event.isPropagated());
    }
View Full Code Here

TOP

Related Classes of java.beans.beancontext.BeanContextServiceRevokedEvent

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.