summaryrefslogtreecommitdiff
path: root/libjava/testsuite/libjava.jni/throwit.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/testsuite/libjava.jni/throwit.java')
-rw-r--r--libjava/testsuite/libjava.jni/throwit.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/libjava/testsuite/libjava.jni/throwit.java b/libjava/testsuite/libjava.jni/throwit.java
new file mode 100644
index 000000000..459622d39
--- /dev/null
+++ b/libjava/testsuite/libjava.jni/throwit.java
@@ -0,0 +1,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 ());
+ }
+ }
+}