Package java.beans.beancontext

Examples of java.beans.beancontext.BeanContextServiceAvailableEvent


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

        BeanContextServiceAvailableEvent event = new MockBeanContextServiceAvailableEvent(
                services, null);
        assertNull(event.getServiceClass());
        assertSame(services, event.getSource());
        assertSame(services, event.getSourceAsBeanContextServices());
    }
View Full Code Here


        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.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

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

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

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

    public void testGetCurrentServiceSelectors() {
        BeanContextServices services = new MockBeanContextServices();
        BeanContextServiceAvailableEvent event = new MockBeanContextServiceAvailableEvent(
                services, BeanContext.class);

        Iterator expectedIt = services
                .getCurrentServiceSelectors(BeanContext.class);
        Iterator it = event.getCurrentServiceSelectors();
        while (expectedIt.hasNext()) {
            assertSame(expectedIt.next(), it.next());
        }
        assertFalse(expectedIt.hasNext());
        assertFalse(it.hasNext());
View Full Code Here

        assertFalse(expectedIt.hasNext());
        assertFalse(it.hasNext());
    }

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

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

                        .getDeserilizedObject(event));
    }


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

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

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

        BeanContextServiceAvailableEvent evt = new BeanContextServiceAvailableEvent(
                support, Collection.class);
        support.publicFireServiceAdded(evt);

        support.records.assertEndOfRecords();
        childSupport.records.assertEndOfRecords();
View Full Code Here

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

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

    BeanContextServiceAvailableEvent availableEvent = new BeanContextServiceAvailableEvent(
        support, c);
      support.serviceAvailable(availableEvent);
        assertEquals(0, serviceRevoked);
        assertEquals(2, serviceAvailable);
       
View Full Code Here

TOP

Related Classes of java.beans.beancontext.BeanContextServiceAvailableEvent

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.