Package java.beans.beancontext

Examples of java.beans.beancontext.BeanContextServiceRevokedEvent


            fail("IAE expected");
        } catch (IllegalArgumentException e) {
            // expected
        }

        BeanContextServiceRevokedEvent event = new MockBeanContextServiceRevokedEvent(
                services, null, true);
        assertNull(event.getServiceClass());
        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());
        assertTrue(event.isCurrentServiceInvalidNow());
        try {
            event.isServiceClass(Integer.class);
            fail("NPE expected");
        } catch (NullPointerException e) {
            // expected
        }
       
        try {
            event.isServiceClass(null);
            fail("NPE expected");
        } catch (NullPointerException e) {
            // expected
        }
       
        event = new MockBeanContextServiceRevokedEvent(services, services
                .getClass(), true);
        assertFalse(event.isServiceClass(null));
    }
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());
    }
View Full Code Here

        assertNotNull(event.getSourceAsBeanContextServices());
    }

    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

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

        BeanContextServiceRevokedEvent evt = new BeanContextServiceRevokedEvent(
                support, Collection.class, false);
        support.publicFireServiceRevoked(evt);

        support.records.assertEndOfRecords();
        childSupport.records.assertEndOfRecords();
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.