2007-02-13 Andrew Haley <aph@redhat.com>
[gcc.git] / libjava / testsuite / libjava.jni / throwit.java
1 // Test to see if throw works.
2
3 public class throwit
4 {
5 static
6 {
7 System.loadLibrary ("throwit");
8 }
9
10 public static native void throwit (String name, boolean is_new);
11
12 public static void main (String[] args)
13 {
14 try
15 {
16 throwit ("java/lang/UnknownError", false);
17 }
18 catch (Throwable x)
19 {
20 System.out.println (x.getClass ());
21 System.out.println (x.getMessage ());
22 }
23 try
24 {
25 throwit ("java/lang/Throwable", true);
26 }
27 catch (Throwable x)
28 {
29 System.out.println (x.getClass ());
30 System.out.println (x.getMessage ());
31 }
32 }
33 }