Package java.beans.beancontext

Examples of java.beans.beancontext.BeanContextServicesSupport


                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


   
    // try an object that doesn't implement the listener interface
    harness.check(MyBeanContextServicesSupport.getChildBeanContextServicesListenerX("XYZ"), null);
   
    // try an object that does implement the interface
    BeanContextServicesSupport bcss = new BeanContextServicesSupport();
    harness.check(MyBeanContextServicesSupport.getChildBeanContextServicesListenerX(bcss), bcss);
  }
View Full Code Here

        event.setPropagatedFrom(null);
        assertNull(event.getPropagatedFrom());
    }
   
    public void testSerialization() throws Exception {
        final BeanContextServicesSupport ctx = new BeanContextServicesSupport(
                null, Locale.FRANCE, false, false);
        final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
                ctx, Locale.ITALY, true, true);
        BeanContextEvent event = new MockBeanContextEvent(ctx2);
        event.setPropagatedFrom(ctx);
        SerializationTest.verifySelf(event, new SerializableAssert(){
            public void assertDeserialized(Serializable arg0, Serializable arg1) {
View Full Code Here

        }
        assertEquals(count, serServices.size());
    }   

    public void testSerializationComptibility() throws Exception {
        final BeanContextServicesSupport ctx = new BeanContextServicesSupport(
                null, Locale.ITALY, true, true);
        final BeanContextServicesSupport ctx2 = new BeanContextServicesSupport(
                null, Locale.CHINA, true, true);
       
        BeanContextEvent event = new MockBeanContextEvent(ctx);
        event.setPropagatedFrom(ctx2);
        SerializationTest.verifyGolden(this, event, new SerializableAssert(){
View Full Code Here

        // covered by testAddService
    }

    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

            revokeCalled = true;
        }
    }

    public void testSerialization() throws IOException, ClassNotFoundException {
        BeanContextServicesSupport support = new BeanContextServicesSupport(
                null, Locale.ITALY, true, true);
        support
                .addBeanContextServicesListener(new MockBeanContextServicesListener());
        support
                .addBeanContextServicesListener(new MockBeanContextServicesListenerS(
                        "l2"));
        support
                .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

    }

  }

  public void test_serviceRevoked_LBeanContextServiceRevokedEvent() {
    BeanContextServicesSupport support = new BeanContextServicesSupport();

    support.add(new MySupport());
    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

        assertEquals(2, serviceAvailable);
       
  }

  public void test_serviceAvailable_LBeanContextServiceRevokedEvent() {
    BeanContextServicesSupport support = new BeanContextServicesSupport();

    support.add(new MySupport());
    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

  }
 
   
 
     public void testSerialization_Compatibility() throws Exception {
         BeanContextServicesSupport support = new BeanContextServicesSupport(
                 null, Locale.ITALY, true, true);
         support
                 .addBeanContextServicesListener(new MockBeanContextServicesListener());
         support
                 .addBeanContextServicesListener(new MockBeanContextServicesListenerS(
                         "l2"));
         support
                 .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

                "designTime"));
    }


    public void testPropertyChangePropertyChangeEvent() {
        BeanContextServicesSupport s = new BeanContextServicesSupport();
        PropertyChangeSupport p= new PropertyChangeSupport(new Object());

        p.addPropertyChangeListener(s);
        p.firePropertyChange(null, new Object(), new Object());
    }
View Full Code Here

TOP

Related Classes of java.beans.beancontext.BeanContextServicesSupport

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.