Examples of EventSetDescriptor


Examples of java.beans.EventSetDescriptor

        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener", listenerType);
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener", listenerType);

        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethodDescriptors, addMethod,
                removeMethod);
        esd.setInDefaultEventSet(true);
        assertTrue(esd.isInDefaultEventSet());
    }
View Full Code Here

Examples of java.beans.EventSetDescriptor

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

        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethodDescriptors, addMethod,
                removeMethod);
        assertTrue(esd.isInDefaultEventSet());
        esd.setInDefaultEventSet(false);
        assertFalse(esd.isInDefaultEventSet());
    }
View Full Code Here

Examples of java.beans.EventSetDescriptor

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

        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethodDescriptors, addMethod,
                removeMethod);
        assertFalse(esd.isUnicast());
        esd.setInDefaultEventSet(true);
        assertTrue(esd.isInDefaultEventSet());
    }
View Full Code Here

Examples of java.beans.EventSetDescriptor

        Method addMethod = sourceClass.getMethod(
                "addMockPropertyChangeListener",listenerType);
        Method removeMethod = sourceClass.getMethod(
                "removeMockPropertyChangeListener", listenerType);

        EventSetDescriptor esd = new EventSetDescriptor(eventSetName,
                listenerType, listenerMethodDescriptors, addMethod,
                removeMethod);
        assertFalse(esd.isUnicast());
        esd.setInDefaultEventSet(false);
        assertFalse(esd.isInDefaultEventSet());
    }
View Full Code Here

Examples of java.beans.EventSetDescriptor

    /**
     * The test checks the constructor
     */
    public void testEventSetDescriptorConstructor() {
        try {
            new EventSetDescriptor(OtherBean.class, "sample",
                    SampleListener.class, "fireSampleEvent");
        } catch (Exception e) {
            fail("Exception of " + e.getClass() + " class with message "
                    + e.getMessage() + " is thrown");
        }
View Full Code Here

Examples of java.beans.EventSetDescriptor

    }
   
    //Regression Test
    public void testConstructor_withLackRemoveActionBean() throws Exception {
        try {
            new EventSetDescriptor(LackRemoveActionBean.class, "action",
                    ActionListener.class, "actionPerformed");
            fail("should throw IntrospectionException");
        } catch (IntrospectionException e) {
            // expected
        }
View Full Code Here

Examples of java.beans.EventSetDescriptor

                AnObjectListener.class);
        Method remove = AnObject.class.getDeclaredMethod(
                "removeEventSetDescriptorTest$AnObjectListener",
                AnObjectListener.class);

        EventSetDescriptor esd = new EventSetDescriptor("something",
                AnObjectListener.class, listenermethods, add, remove);
        assertNotNull(esd);
    }
View Full Code Here

Examples of java.beans.EventSetDescriptor

                Method add = AnObject.class.getDeclaredMethod( "addEventSetDescriptorTest3$AnObjectListener",
                                                                AnObjectListener.class );
                Method remove = AnObject.class.getDeclaredMethod( "removeEventSetDescriptorTest3$AnObjectListener",
                                                                AnObjectListener.class );

                EventSetDescriptor esd = new EventSetDescriptor("something",
                    AnObjectListener.class, listenermethods, add, remove);
            System.out.println("Test passed.");
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("Test failed.");
View Full Code Here

Examples of java.beans.EventSetDescriptor

            SecurityException, NoSuchMethodException {
        String eventSetName = "mockPropertyChange";
        String listenerMethodName = eventSetName;
        Class<MockSourceClass> sourceClass = MockSourceClass.class;
        Class<?> listenerType = MockPropertyChangeListener.class;
        EventSetDescriptor esd = null;
        esd = new EventSetDescriptor(sourceClass, eventSetName, listenerType,
                listenerMethodName);
        String listenerName = getUnQualifiedClassName(listenerType);
        Method addMethod = sourceClass.getMethod("add" + listenerName,
                new Class[] { listenerType });
        Method removeMethod = sourceClass.getMethod("remove" + listenerName,
                new Class[] { listenerType });

        assertEquals(addMethod, esd.getAddListenerMethod());
        assertEquals(removeMethod, esd.getRemoveListenerMethod());
        assertNull(esd.getGetListenerMethod());
        assertEquals(1, esd.getListenerMethods().length);
        assertEquals(listenerMethodName, esd.getListenerMethods()[0].getName());
        assertEquals(1, esd.getListenerMethodDescriptors().length);
        assertEquals(listenerMethodName, esd.getListenerMethodDescriptors()[0]
                .getMethod().getName());

        assertEquals(listenerType, esd.getListenerType());
        assertTrue(esd.isInDefaultEventSet());
        assertFalse(esd.isUnicast());
       
        esd = new EventSetDescriptor(AnObject.class, "something",
                AnObjectListener.class, "aMethod");
    }
View Full Code Here

Examples of java.beans.EventSetDescriptor

        String listenerMethodName = eventSetName;
        Class<MockSourceClass> sourceClass = MockSourceClass.class;
        Class<?> listenerType = MockPropertyChangeListener.class;

        try {
            new EventSetDescriptor(sourceClass, "FFF", listenerType,
                    listenerMethodName);
            fail("Should throw IntrospectionException.");
        } catch (IntrospectionException e) {
            // valid
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.