OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libjava/] [classpath/] [test/] [java.beans/] [DescriptorTest.java] - Blame information for rev 14

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 14 jlechner
import java.beans.*;
2
 
3
public class DescriptorTest implements Runnable {
4
        public static void main(String[] args) {
5
                new DescriptorTest().run();
6
        }
7
 
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);
13
        }
14
 
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();
22
                }
23
 
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();
30
                }
31
 
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();
38
                }
39
 
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();
46
                }
47
        }
48
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.