Package java.beans

Examples of java.beans.EventSetDescriptor


     */
    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


        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

                "mockPropertyChange2", };
        String addMethod = "addMockPropertyChangeListener";
        String removeMethod = "removeMockPropertyChangeListener";
        String getMethod = null;

        EventSetDescriptor esd = new EventSetDescriptor(sourceClass,
                eventSetName, listenerType, listenerMethodNames, addMethod,
                removeMethod, getMethod);
        assertNull(esd.getGetListenerMethod());
   
    //Regression for Harmony-1504
        try {
            new EventSetDescriptor(sourceClass,
                    eventSetName, listenerType, null, addMethod,
                    removeMethod, getMethod);
            fail("NullPointerException expected");
        } catch (NullPointerException e) {
            //expected
View Full Code Here

        String[] listenerMethodNames = { "mockPropertyChange",
                "mockPropertyChange2", };
        String addMethod = "addMockPropertyChangeListener";
        String removeMethod = "removeMockPropertyChangeListener";
        String getMethod = addMethod;
        EventSetDescriptor esd = new EventSetDescriptor(sourceClass,
                eventSetName, listenerType, listenerMethodNames, addMethod,
                removeMethod, getMethod);
    assertNull(esd.getGetListenerMethod());
    }
View Full Code Here

        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener", new Class[] { listenerType });
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener",
                new Class[] { listenerType });
        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethods, addMethod, removeMethod);

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

        // RI reports true in the following assertion, so it returns exactly
        // the same array as it was specified in the EventSetDescriptor
        // construtor.
        assertEquals(listenerMethods, esd.getListenerMethods());

        assertEquals(2, esd.getListenerMethodDescriptors().length);
        assertEquals(listenerMethods[0], esd.getListenerMethodDescriptors()[0]
                .getMethod());
        assertEquals(listenerMethods[1], esd.getListenerMethodDescriptors()[1]
                .getMethod());

        assertEquals(listenerType, esd.getListenerType());
        assertTrue(esd.isInDefaultEventSet());
        assertFalse(esd.isUnicast());
    }
View Full Code Here

        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener", new Class[] { listenerType });
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener",
                new Class[] { listenerType });
        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethods, addMethod, removeMethod);

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

        assertEquals(2, esd.getListenerMethodDescriptors().length);
        assertEquals(listenerMethods[0], esd.getListenerMethodDescriptors()[0]
                .getMethod());
        assertEquals(listenerMethods[1], esd.getListenerMethodDescriptors()[1]
                .getMethod());

        assertEquals(listenerType, esd.getListenerType());
        assertTrue(esd.isInDefaultEventSet());
        assertFalse(esd.isUnicast());
    }
View Full Code Here

        Class<MockSourceClass> sourceClass = MockSourceClass.class;
        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener", listenerType);
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener", listenerType);
        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethods, addMethod, removeMethod);

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

        //RI asserts to true here
        assertEquals(listenerMethods, esd.getListenerMethods());

        assertEquals(2, esd.getListenerMethodDescriptors().length);
        assertEquals(listenerMethods[0], esd.getListenerMethodDescriptors()[0]
                .getMethod());
        assertEquals(listenerMethods[1], esd.getListenerMethodDescriptors()[1]
                .getMethod());

        assertEquals(listenerType, esd.getListenerType());
        assertTrue(esd.isInDefaultEventSet());
        assertFalse(esd.isUnicast());
    }
View Full Code Here

        Class<MockSourceClass> sourceClass = MockSourceClass.class;
        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener", listenerType);
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener", listenerType);
        EventSetDescriptor esd = new EventSetDescriptor(eventSetName, null,
                listenerMethods, addMethod, removeMethod);

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

        assertEquals(2, esd.getListenerMethodDescriptors().length);
        assertEquals(listenerMethods[0], esd.getListenerMethodDescriptors()[0]
                .getMethod());
        assertEquals(listenerMethods[1], esd.getListenerMethodDescriptors()[1]
                .getMethod());

        assertNull(esd.getListenerType());
        assertTrue(esd.isInDefaultEventSet());
        assertFalse(esd.isUnicast());
    }
View Full Code Here

        Class<MockSourceClass> sourceClass = MockSourceClass.class;
        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener", listenerType);
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener", listenerType);
        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, (Method[]) null, addMethod, removeMethod);

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

        assertNull(esd.getListenerMethods());
        assertNull(esd.getListenerMethodDescriptors());

        assertEquals(listenerType, esd.getListenerType());
        assertTrue(esd.isInDefaultEventSet());
        assertFalse(esd.isUnicast());
    }
View Full Code Here

        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener", new Class[] { listenerType });
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener",
                new Class[] { listenerType });
        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethods, addMethod, removeMethod);
        assertEquals(listenerMethods, esd.getListenerMethods());
    }
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.