PR target/27599
[official-gcc.git] / libjava / classpath / test / java.beans / DescriptorTest.java
blob31d2bd090776985b8ab7773985aed61cd78e19e0
1 import java.beans.*;
3 public class DescriptorTest implements Runnable {
4 public static void main(String[] args) {
5 new DescriptorTest().run();
8 interface TestClass {
9 public String[] getTest();
10 public void setTest(String[] test);
11 public String getTest(int i);
12 public void setTest(int i, String name);
15 public void run() {
16 try {
17 new PropertyDescriptor("class",java.lang.Object.class);
18 System.out.println("PASSED: Property Object.class");
19 } catch(IntrospectionException e) {
20 System.out.println("FAILED: Property Object.class");
21 e.printStackTrace();
24 try {
25 new IndexedPropertyDescriptor("test",TestClass.class);
26 System.out.println("PASSED: Indexed Property Component.location");
27 } catch(IntrospectionException e) {
28 System.out.println("FAILED: Indexed Property Component.location");
29 e.printStackTrace();
32 try {
33 new EventSetDescriptor(java.awt.Button.class,"action",java.awt.event.ActionListener.class,"actionPerformed");
34 System.out.println("PASSED: Event Set Button.action");
35 } catch(IntrospectionException e) {
36 System.out.println("FAILED: Event Set Button.action");
37 e.printStackTrace();
40 try {
41 new MethodDescriptor(java.awt.Component.class.getMethod("getLocation",new Class[0]));
42 System.out.println("PASSED: Method Component.getLocation");
43 } catch(NoSuchMethodException e) {
44 System.out.println("FAILED: No such method: Component.getLocation()");
45 e.printStackTrace();