throwit.java: New file.
* libjava.jni/throwit.java: New file. * libjava.jni/throwit.c: New file. * libjava.jni/throwit.out: New file. From-SVN: r32016
This commit is contained in:
parent
b32369e675
commit
5b0d59b4e7
4 changed files with 68 additions and 0 deletions
33
libjava/testsuite/libjava.jni/throwit.java
Normal file
33
libjava/testsuite/libjava.jni/throwit.java
Normal file
|
@ -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 ());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue