类java.beans.IndexedPropertyChangeEvent源码实例Demo

下面列出了怎么用java.beans.IndexedPropertyChangeEvent的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: dragonwell8_jdk   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码2 项目: TencentKona-8   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码3 项目: jdk8u60   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码4 项目: openjdk-jdk8u   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码5 项目: openjdk-jdk8u-backup   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码6 项目: openjdk-jdk9   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码7 项目: jdk8u-jdk   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码8 项目: hottub   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码9 项目: openjdk-8-source   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码10 项目: openjdk-8   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码11 项目: jdk8u_jdk   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码12 项目: jdk8u-jdk   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码13 项目: jdk8u-dev-jdk   文件: Test4353056.java
public void propertyChange(PropertyChangeEvent event) {
    Object value = event.getNewValue();
    if (value.equals(event.getOldValue())) {
        throw new Error("new value is equal to old one");
    }
    if (!this.name.equals(event.getPropertyName())) {
        throw new Error("unexpected property name");
    } else if (this.name.equals(COLOR)) {
        if (!value.equals(this.color)) {
            throw new Error("unexpected object value");
        }
    } else if (this.name.equals(BOOLEAN)) {
        if (!value.equals(Boolean.valueOf(this.flag))) {
            throw new Error("unexpected boolean value");
        }
    } else if (this.name.equals(INTEGER)) {
        if (!value.equals(Integer.valueOf(this.value))) {
            throw new Error("unexpected integer value");
        }
    } else {
        throw new Error("unexpected property name");
    }
    if (event instanceof IndexedPropertyChangeEvent) {
        IndexedPropertyChangeEvent ipce = (IndexedPropertyChangeEvent) event;
        if (this.index != ipce.getIndex()) {
            throw new Error("unexpected property index");
        }
    } else {
        throw new Error("unexpected event type");
    }
    System.out.println(this.name + " at " + this.index + " is " + value);

    this.name = null;
    this.index = -1;
}
 
源代码14 项目: dragonwell8_jdk   文件: Test4498236.java
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) )
    );
}
 
源代码15 项目: TencentKona-8   文件: Test4498236.java
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) )
    );
}
 
源代码16 项目: jdk8u60   文件: Test4498236.java
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) )
    );
}
 
源代码17 项目: openjdk-jdk8u   文件: Test4498236.java
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) )
    );
}
 
源代码18 项目: openjdk-jdk8u-backup   文件: Test4498236.java
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) )
    );
}
 
源代码19 项目: openjdk-jdk9   文件: Test4498236.java
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) )
    );
}
 
源代码20 项目: jdk8u-jdk   文件: Test4498236.java
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) )
    );
}
 
源代码21 项目: hottub   文件: Test4498236.java
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) )
    );
}
 
源代码22 项目: openjdk-8-source   文件: Test4498236.java
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) )
    );
}
 
源代码23 项目: openjdk-8   文件: Test4498236.java
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) )
    );
}
 
源代码24 项目: jdk8u_jdk   文件: Test4498236.java
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) )
    );
}
 
源代码25 项目: jdk8u-jdk   文件: Test4498236.java
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) )
    );
}
 
源代码26 项目: jdk8u-dev-jdk   文件: Test4498236.java
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) )
    );
}
 
源代码27 项目: pentaho-reporting   文件: ReportDesignerFrame.java
/**
 * This method gets called when a bound property is changed.
 *
 * @param evt A PropertyChangeEvent object describing the event source and the property that has changed.
 */

public void propertyChange( final PropertyChangeEvent evt ) {
  if ( ReportDesignerContext.REPORT_RENDER_CONTEXT_PROPERTY.equals( evt.getPropertyName() ) == false ) {
    return;
  }

  if ( !( evt instanceof IndexedPropertyChangeEvent ) ) {
    throw new UnsupportedOperationException();
  }

  final JTabbedPane editorPanes = getReportEditorPane();
  final IndexedPropertyChangeEvent ievt = (IndexedPropertyChangeEvent) evt;
  if ( ievt.getNewValue() != null ) {
    // added
    final ReportRenderContext renderContext = (ReportRenderContext) ievt.getNewValue();
    DefaultReportDesignerContext reportDesignerContext = getContext();
    final ReportRendererComponent rendererComponent =
      new ReportRendererComponent( reportDesignerContext, renderContext );

    final String title = renderContext.getTabName();
    final Icon icon = renderContext.getIcon();
    final TabRenderer tabRenderer = new TabRenderer( icon, title, reportDesignerContext, editorPanes );
    editorPanes.addTab( title, null, rendererComponent );
    editorPanes.setTabComponentAt( editorPanes.getTabCount() - 1, tabRenderer );
    editorPanes.setSelectedComponent( rendererComponent );
    renderContext.addPropertyChangeListener( "tabName",
      new DocumentNameChangeHandler( renderContext, tabRenderer, editorPanes.getTabCount() - 1 ) );

  } else if ( ievt.getOldValue() != null ) {
    if ( editorPanes.getTabCount() <= 0 ) {
      return;
    }
    // removed
    int index = ievt.getIndex();
    final ReportRenderContext reportRenderContext = (ReportRenderContext) ievt.getOldValue();
    boolean removedTab = false;

    for ( int i = 0; i < editorPanes.getTabCount(); i++ ) {
      final Component tabContent = editorPanes.getComponentAt( i );
      if ( tabContent instanceof ReportRendererComponent ) {
        final ReportRendererComponent myReportRenderer = (ReportRendererComponent) tabContent;
        if ( myReportRenderer.getRenderContext() == reportRenderContext ) {
          index = i;
          editorPanes.removeTabAt( index );
          removedTab = true;
          myReportRenderer.dispose();
          break;
        }
      }
    }

    // if we didn't remove a tab, the tab was probably not a report, so remove it by index
    if ( !removedTab ) {
      editorPanes.removeTabAt( index );
    }

    // unregister the listeners ...
    if ( editorPanes.getTabCount() > 0 ) {
      if ( index < editorPanes.getTabCount() ) {
        editorPanes.setSelectedIndex( index );
      } else {
        editorPanes.setSelectedIndex( editorPanes.getTabCount() - 1 );
      }
    }
  }

  recomputeAllTabTitles();
  rebuildReportMenu();
}
 
 类所在包
 类方法
 同包方法