java.beans.ParameterDescriptor Java Examples

The following examples show how to use java.beans.ParameterDescriptor. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MethodDescriptorTest.java    From j2objc with Apache License 2.0 6 votes vote down vote up
public void testMethodDescriptorMethodParameterDescriptorArray()
        throws SecurityException, NoSuchMethodException {
    String beanName = "MethodDescriptorTest.bean";
    MockJavaBean bean = new MockJavaBean(beanName);
    Method method = bean.getClass().getMethod("setPropertyOne",
            new Class[] { String.class });
    ParameterDescriptor[] pds = new ParameterDescriptor[1];
    pds[0] = new ParameterDescriptor();
    pds[0].setValue(method.getName(), method.getReturnType());
    MethodDescriptor md = new MethodDescriptor(method, pds);

    assertSame(method, md.getMethod());
    assertSame(pds, md.getParameterDescriptors());
    assertEquals(pds[0].getValue(method.getName()), md
            .getParameterDescriptors()[0].getValue(method.getName()));

    assertEquals(method.getName(), md.getDisplayName());
    assertEquals(method.getName(), md.getName());
    assertEquals(method.getName(), md.getShortDescription());

    assertNotNull(md.attributeNames());

    assertFalse(md.isExpert());
    assertFalse(md.isHidden());
    assertFalse(md.isPreferred());
}
 
Example #2
Source File: Test8005065.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #3
Source File: ParameterDescriptorTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void testParameterDescriptor() {
    ParameterDescriptor pd = new ParameterDescriptor();
    assertNull(pd.getDisplayName());
    assertNull(pd.getName());
    assertNull(pd.getShortDescription());

    assertNotNull(pd.attributeNames());

    assertFalse(pd.isExpert());
    assertFalse(pd.isHidden());
    assertFalse(pd.isPreferred());
}
 
Example #4
Source File: MethodDescriptorTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
/**
 * @tests java.beans.MethodDescriptor#MethodDescriptor(
 *        java.lang.reflect.Method, java.beans.ParameterDescriptor[])
 */
public void test_Ctor2_NullPointerException() {
    try {
        // Regression for HARMONY-226
        new MethodDescriptor(null, new ParameterDescriptor[0]);
        fail("No expected NullPointerException");
    } catch (NullPointerException e) {
    }
}
 
Example #5
Source File: MethodDescriptorTest.java    From j2objc with Apache License 2.0 5 votes vote down vote up
public void testMethodDescriptorMethodParameterDescriptorArray_MethodNull() {
    Method method = null;
    ParameterDescriptor[] pds = new ParameterDescriptor[1];
    pds[0] = new ParameterDescriptor();
    try {
        new MethodDescriptor(method, pds);
        fail("Should throw NullPointerException.");
    } catch (NullPointerException e) {
    }
}
 
Example #6
Source File: Test8005065.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #7
Source File: Test8005065.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #8
Source File: Test8005065.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #9
Source File: Test8005065.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #10
Source File: Test8005065.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #11
Source File: Test8005065.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #12
Source File: Test8005065.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #13
Source File: Test8005065.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #14
Source File: Test4058433.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void print(MethodDescriptor[] mds) {
    System.out.println(mds.length + " method descriptors");
    Arrays.sort(mds, new Test4058433());
    for (MethodDescriptor md : mds) {
        print(md);
        print("method", md.getMethod());
        ParameterDescriptor[] pds = md.getParameterDescriptors();
        if (pds != null) {
            System.out.println(pds.length + " parameter descriptors");
            for (ParameterDescriptor pd : pds) {
                print(pd);
            }
        }
    }
}
 
Example #15
Source File: Test8005065.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #16
Source File: Test8005065.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #17
Source File: Test8005065.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #18
Source File: Test8005065.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void testMethodDescriptor() {
    try {
        ParameterDescriptor[] array = { new ParameterDescriptor() };
        MethodDescriptor descriptor = new MethodDescriptor(MyDPD.class.getMethod("getArray"), array);
        test(descriptor.getParameterDescriptors());
        array[0] = null;
        test(descriptor.getParameterDescriptors());
        descriptor.getParameterDescriptors()[0] = null;
        test(descriptor.getParameterDescriptors());
    }
    catch (Exception exception) {
        throw new Error("unexpected error", exception);
    }
}
 
Example #19
Source File: Test4498236.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #20
Source File: Test4498236.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #21
Source File: Test4498236.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #22
Source File: Test4498236.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #23
Source File: Test4498236.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #24
Source File: Test4498236.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #25
Source File: Test4498236.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #26
Source File: Test4498236.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #27
Source File: Test4498236.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #28
Source File: Test4498236.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #29
Source File: Test4498236.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}
 
Example #30
Source File: Test4498236.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static void main(String[] args) throws Exception {
    PropertyChangeEvent event = new PropertyChangeEvent("source", null, null, null);
    event.setPropagationId("id");
    test("[propertyName=null; oldValue=null; newValue=null; propagationId=id; source=source]", event);
    test("[propertyName=name; oldValue=old; newValue=new; propagationId=null; source=source]",
         new PropertyChangeEvent("source", "name", "old", "new")
    );
    test("[propertyName=array; index=5; oldValue=old; newValue=new; propagationId=null; source=source]",
         new IndexedPropertyChangeEvent("source", "array", "old", "new", 5)
    );
    FeatureDescriptor fd = new FeatureDescriptor();
    fd.setName("n");
    fd.setDisplayName("dn");
    fd.setShortDescription("sd");
    fd.setPreferred(true);
    fd.setHidden(true);
    fd.setExpert(true);
    fd.setValue("first", "value");
    test("[name=n; displayName=dn; shortDescription=sd; preferred; hidden; expert; values={first=value}]", fd);
    test("[name=String; beanClass=class java.lang.String]",
         new BeanDescriptor(String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=Object; beanClass=class java.lang.Object; customizerClass=class java.lang.String]",
         new BeanDescriptor(Object.class, String.class)
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object)]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class))
    );
    test("[name=equals; method=public boolean java.lang.Object.equals(java.lang.Object); parameterDescriptors={java.beans.ParameterDescriptor[name=null]}]",
         new MethodDescriptor(Object.class.getMethod("equals", Object.class), new ParameterDescriptor[] {
                 new ParameterDescriptor()
         })
    );
    Class type = KeyListener.class;
    String[] names = { "keyTyped", "keyPressed", "keyReleased" };
    Method[] methods = new Method[names.length];
    for (int i = 0; i < names.length; i++) {
        methods[i] = type.getMethod(names[i], KeyEvent.class);
    }
    test("[name=key; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.getKeyListeners(); addListenerMethod=public void Test4498236.addKeyListener(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.removeKeyListener(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "key", type, names[0])
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor(Test4498236.class, "$$$", type, names, "add", "remove", "get")
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type))
    );
    test("[name=$$$; inDefaultEventSet; listenerType=interface java.awt.event.KeyListener; getListenerMethod=public java.awt.event.KeyListener Test4498236.get(); addListenerMethod=public void Test4498236.add(java.awt.event.KeyListener); removeListenerMethod=public void Test4498236.remove(java.awt.event.KeyListener)]",
         new EventSetDescriptor("$$$", type, methods, Test4498236.class.getMethod("add", type), Test4498236.class.getMethod("remove", type), Test4498236.class.getMethod("get"))
    );
    test("[name=value; propertyType=boolean; readMethod=public boolean Test4498236.isValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("value", Test4498236.class)
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", Test4498236.class, null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class, "getValue", "setValue")
    );
    test("[name=$$$]",
         new PropertyDescriptor("$$$", null, null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue()]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), null)
    );
    test("[name=$$$; propertyType=boolean; readMethod=public boolean Test4498236.getValue(); writeMethod=public void Test4498236.setValue(boolean)]",
         new PropertyDescriptor("$$$", Test4498236.class.getMethod("getValue"), Test4498236.class.getMethod("setValue", boolean.class))
    );
    test("[name=index; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("index", Test4498236.class)
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class, "getIndex", "setIndex", "getIndex", "setIndex")
    );
    test("[name=$$$; propertyType=class [I; readMethod=public int[] Test4498236.getIndex(); writeMethod=public void Test4498236.setIndex(int[]); indexedPropertyType=int; indexedReadMethod=public int Test4498236.getIndex(int); indexedWriteMethod=public void Test4498236.setIndex(int,int)]",
         new IndexedPropertyDescriptor("$$$", Test4498236.class.getMethod("getIndex"), Test4498236.class.getMethod("setIndex", new int[0].getClass()), Test4498236.class.getMethod("getIndex", int.class), Test4498236.class.getMethod("setIndex", int.class, int.class) )
    );
}