Package java.beans

Examples of java.beans.EventSetDescriptor


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

        try {
            new EventSetDescriptor(sourceClass, eventSetName, listenerType,
                    listenerMethodNames, addMethod, removeMethod);
            fail("Should throw NullPointerException.");
        } catch (NullPointerException e) {
        }
    }
View Full Code Here


        String[] listenerMethodNames = { "mockPropertyChange",
                "mockPropertyChange2", };
        String addMethod = "addMockPropertyChangeListener";
        String removeMethod = "removeMockPropertyChangeListener";

        EventSetDescriptor esd = new EventSetDescriptor(sourceClass,
                eventSetName, listenerType, listenerMethodNames, addMethod,
                removeMethod);
        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-1504
    try {
      new EventSetDescriptor(sourceClass,
        null, listenerType, listenerMethodNames, addMethod,
        removeMethod);
      fail("NullPointerException expected");
    } catch (NullPointerException e) {
      //expected
View Full Code Here

        try {
            // RI doesn't throw exception here but this
            // is against the java.beans package description:
            // null values or empty Strings are not
            // valid parameters unless explicitly stated
            EventSetDescriptor esd = new EventSetDescriptor(sourceClass,
                    eventSetName, listenerType, listenerMethodNames, addMethod,
                    removeMethod);           
        } catch (IntrospectionException e) {
            // valid
        }
View Full Code Here

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

        Class<?> listenerType = MockPropertyChangeListener.class;
        String[] listenerMethodNames = null;
        String addMethod = "addMockPropertyChangeListener";
        String removeMethod = "removeMockPropertyChangeListener";
        try {
            new EventSetDescriptor(sourceClass, eventSetName, listenerType,
                    listenerMethodNames, addMethod, removeMethod);
            fail("Should throw NullPointerException.");
        } catch (NullPointerException e) {
            // expected
        }
       
        try {
            new EventSetDescriptor(sourceClass, eventSetName, listenerType,
                    new String[] { null }, addMethod, removeMethod);
            fail("Should throw NullPointerException.");
        } catch (NullPointerException e) {
            // expected
        }
View Full Code Here

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

        Class<?> listenerType = MockPropertyChangeValidListener.class;
        String[] listenerMethodNames = { "mockPropertyChange_Valid",
                "mockPropertyChange2", };
        String addMethod = "addMockPropertyChangeListener";
        String removeMethod = "removeMockPropertyChangeListener";
        EventSetDescriptor eventSetDescriptor = new EventSetDescriptor(
                sourceClass, eventSetName, listenerType, listenerMethodNames,
                addMethod, removeMethod);
        assertEquals(2, eventSetDescriptor.getListenerMethods().length);
    }
View Full Code Here

        String eventSetName = "MockPropertyChange";
        Class<?> listenerType = MockPropertyChangeListener.class;
        String[] listenerMethodNames = {};
        String addMethod = "addMockPropertyChangeListener";
        String removeMethod = "removeMockPropertyChangeListener";
        EventSetDescriptor esd = new EventSetDescriptor(sourceClass,
                eventSetName, listenerType, listenerMethodNames, addMethod,
                removeMethod);
        assertEquals(0, esd.getListenerMethods().length);
    }
View Full Code Here

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

        String[] listenerMethodNames = { "mockPropertyChange",
                "mockPropertyChange2", };
        String addMethod = "addMockPropertyChangeListener_Invalid";
        String removeMethod = "removeMockPropertyChangeListener";
        try {
            new EventSetDescriptor(sourceClass, eventSetName, listenerType,
                    listenerMethodNames, addMethod, removeMethod);
            fail("Should throw IntrospectionException.");
        } catch (IntrospectionException e) {
        }
    }
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.