Package java.beans.beancontext

Examples of java.beans.beancontext.BeanContextServices


    public static void main(String[] args) {
        junit.textui.TestRunner.run(BeanContextServiceRevokedEventTest.class);
    }

    public void testBeanContextServiceRevokedEvent_NullParam() {
        BeanContextServices services = new MockBeanContextServices();

        try {
            new MockBeanContextServiceRevokedEvent(null, BeanContext.class,
                    true);
            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


                .getClass(), true);
        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());
View Full Code Here

        assertSame(services, event.getSourceAsBeanContextServices());
        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());
View Full Code Here

                MockBeanContextServices.class, false);
        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

                services, BeanContext.class, true);
        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));
View Full Code Here

        // Regression for HARMONY-1516
        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);
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());
View Full Code Here

    public static void main(String[] args) {
        junit.textui.TestRunner.run(BeanContextServiceAvailableEventTest.class);
    }

    public void testBeanContextServiceAvailableEvent_NullParam() {
        BeanContextServices services = new MockBeanContextServices();

        try {
            new MockBeanContextServiceAvailableEvent(null, BeanContext.class);
            fail("IAE expected");
        } catch (IllegalArgumentException e) {
View Full Code Here

        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());
    }

    public void testBeanContextServiceAvailableEvent() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceAvailableEvent event = new MockBeanContextServiceAvailableEvent(
                services, BeanContext.class);
        assertSame(BeanContext.class, event.getServiceClass());
        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());
View Full Code Here

        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());
    }

    public void testGetSourceAsBeanContextServices() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceAvailableEvent event = new MockBeanContextServiceAvailableEvent(
                services, BeanContext.class);
        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());
    }
View Full Code Here

TOP

Related Classes of java.beans.beancontext.BeanContextServices

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.