aboutsummaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.jni/throwit.java
blob: 459622d390fdff02d5e8e79e862d1cd85d1e298a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Test to see if throw works.

public class throwit
{
  static
  {
    System.loadLibrary ("throwit");
  }

  public static native void throwit (String name, boolean is_new);

  public static void main (String[] args)
  {
    try
      {
	throwit ("java/lang/UnknownError", false);
      }
    catch (Throwable x)
      {
	System.out.println (x.getClass ());
	System.out.println (x.getMessage ());
      }
    try
      {
	throwit ("java/lang/Throwable", true);
      }
    catch (Throwable x)
      {
	System.out.println (x.getClass ());
	System.out.println (x.getMessage ());
      }
  }
}