Package java.beans

Examples of java.beans.EventSetDescriptor


        Class<?> listenerType = MockPropertyChangeListener.class;
        String[] listenerMethodNames = { "mockPropertyChange",
                "mockPropertyChange2", };
        String addMethod = "removeMockPropertyChangeListener";
        String removeMethod = null;
        EventSetDescriptor esd = new EventSetDescriptor(sourceClass,
                eventSetName, listenerType, listenerMethodNames, addMethod,
                removeMethod);
        assertNull(esd.getRemoveListenerMethod());
    }
View Full Code Here


        String[] listenerMethodNames = { "mockPropertyChange",
                "mockPropertyChange2", };
        String addMethod = "removeMockPropertyChangeListener";
        String removeMethod = "addMockPropertyChangeListener_Invalid";
        try {
            new EventSetDescriptor(sourceClass, eventSetName, listenerType,
                    listenerMethodNames, addMethod, removeMethod);
            fail("Should throw IntrospectionException.");
        } catch (IntrospectionException e) {
        }
View Full Code Here

        String[] listenerMethodNames = { "mockPropertyChange",
                "mockPropertyChange2", };
        String addMethod = "addMockPropertyChangeListener";
        String removeMethod = "removeMockPropertyChangeListener";
        String getMethod = "getMockPropertyChangeListener";
        EventSetDescriptor esd = new EventSetDescriptor(sourceClass,
                eventSetName, listenerType, listenerMethodNames, addMethod,
                removeMethod, getMethod);

        assertEquals(addMethod, esd.getAddListenerMethod().getName());
        assertEquals(removeMethod, esd.getRemoveListenerMethod().getName());
    assertNull(esd.getGetListenerMethod());

        assertEquals(2, esd.getListenerMethods().length);
        assertEquals(listenerMethodNames[0], esd.getListenerMethods()[0]
                .getName());
        assertEquals(listenerMethodNames[1], esd.getListenerMethods()[1]
                .getName());
        assertEquals(2, esd.getListenerMethodDescriptors().length);
        assertEquals(listenerMethodNames[0],
                esd.getListenerMethodDescriptors()[0].getMethod().getName());
        assertEquals(listenerMethodNames[1],
                esd.getListenerMethodDescriptors()[1].getMethod().getName());

        assertEquals(listenerType, esd.getListenerType());
        assertTrue(esd.isInDefaultEventSet());
        assertFalse(esd.isUnicast());
        // Regression for HARMONY-1237
        try {
            new EventSetDescriptor(Thread.class, "0xABCD", Thread.class,
                    new String[] {}, "aaa", null, "bbb");
            fail("IntrospectionException expected");
        } catch (IntrospectionException e) {
            // expected
        }
View Full Code Here

     */
    public void testIntrospection_10() throws IntrospectionException {
        Class<FakeFox601> beanClass = FakeFox601.class;
        BeanInfo info = Introspector.getBeanInfo(beanClass);
        PropertyDescriptor[] propertyDesc;
        EventSetDescriptor eventDesc;
       
        assertEquals(1, info.getEventSetDescriptors().length);
        eventDesc = info.getEventSetDescriptors()[0];
        assertNotNull(eventDesc.getAddListenerMethod());
        assertNotNull(eventDesc.getRemoveListenerMethod());
        assertNull(eventDesc.getGetListenerMethod());
        assertEquals(1, eventDesc.getListenerMethods().length);

        assertEquals(11, info.getMethodDescriptors().length);

        propertyDesc = info.getPropertyDescriptors();
        assertEquals(1, propertyDesc.length);
View Full Code Here

     * Test introspect events, add/remove/get
     */
    public void testIntrospection_11() throws IntrospectionException {
        Class<FakeFox602> beanClass = FakeFox602.class;
        BeanInfo info = Introspector.getBeanInfo(beanClass);
        EventSetDescriptor eventDesc;
        PropertyDescriptor[] propertyDesc;

        assertEquals(1, info.getEventSetDescriptors().length);
        eventDesc = info.getEventSetDescriptors()[0];
        assertFalse(eventDesc.isUnicast());
        assertNotNull(eventDesc.getAddListenerMethod());
        assertNotNull(eventDesc.getRemoveListenerMethod());
        assertNotNull(eventDesc.getGetListenerMethod());
        assertEquals(1, eventDesc.getListenerMethods().length);

        assertEquals(12, info.getMethodDescriptors().length);

        propertyDesc = info.getPropertyDescriptors();
        assertEquals(2, propertyDesc.length);
View Full Code Here

     */
    public void testIntrospection_13() throws IntrospectionException {
        Class<FakeFox604> beanClass = FakeFox604.class;
        BeanInfo info = Introspector.getBeanInfo(beanClass);
        assertEquals(1, info.getEventSetDescriptors().length);
        EventSetDescriptor eventDesc = info.getEventSetDescriptors()[0];
        assertTrue(eventDesc.isUnicast());
        assertNotNull(eventDesc.getAddListenerMethod());
        assertNotNull(eventDesc.getRemoveListenerMethod());
        assertNull(eventDesc.getGetListenerMethod());
        assertEquals(1, eventDesc.getListenerMethods().length);

        assertEquals(11, info.getMethodDescriptors().length);

        PropertyDescriptor[] propertyDesc = info.getPropertyDescriptors();
        assertEquals(1, propertyDesc.length);
View Full Code Here

            }

            mEventSetByName = new HashMap();
            EventSetDescriptor[] esds = mBeanInfo.getEventSetDescriptors();
            for (int i = 0; esds != null && i < esds.length; i++) {
                EventSetDescriptor esd = esds[i];
                mEventSetByName.put(esd.getName(), esd);
            }
        }
        catch (IntrospectionException exc) {
            if (pLogger.isLoggingWarning()) {
                pLogger.logWarning
View Full Code Here

      }

      mEventSetByName = new HashMap ();
      EventSetDescriptor [] esds = mBeanInfo.getEventSetDescriptors ();
      for (int i = 0; esds != null && i < esds.length; i++) {
  EventSetDescriptor esd = esds [i];
  mEventSetByName.put (esd.getName (), esd);
      }
    }
    catch (IntrospectionException exc) {
      if (pLogger.isLoggingWarning ()) {
  pLogger.logWarning
View Full Code Here

      }

      mEventSetByName = new HashMap ();
      EventSetDescriptor [] esds = mBeanInfo.getEventSetDescriptors ();
      for (int i = 0; esds != null && i < esds.length; i++) {
  EventSetDescriptor esd = esds [i];
  mEventSetByName.put (esd.getName (), esd);
      }
    }
    catch (IntrospectionException exc) {
      if (pLogger.isLoggingWarning ()) {
  pLogger.logWarning
View Full Code Here

        Class consumerClass = consumer.getClass();

        int count = 0;
        for (int i = 0; i < sets.length; i++)
        {
            EventSetDescriptor set = sets[i];
            String name = set.getName();

            if (nameMatch)
            {
                if (!eventSetName.equals(name))
                    continue;
View Full Code Here

TOP

Related Classes of java.beans.EventSetDescriptor

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.