import source from 1.3.40
[external/swig.git] / Examples / test-suite / java / using_pointers_runme.java
1
2 import using_pointers.*;
3
4 public class using_pointers_runme {
5
6   static {
7     try {
8         System.loadLibrary("using_pointers");
9     } catch (UnsatisfiedLinkError e) {
10       System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
11       System.exit(1);
12     }
13   }
14
15   public static void main(String argv[]) 
16   {
17     FooBar f = new FooBar();
18     boolean pass = true;
19     try {
20       f.exception_spec(1);
21       pass = false;
22     } catch (RuntimeException e) {
23     }
24     if (!pass) throw new RuntimeException("Missed exception 1");
25     try {
26       f.exception_spec(2);
27       pass = false;
28     } catch (RuntimeException e) {
29     }
30     if (!pass) throw new RuntimeException("Missed exception 2");
31   }
32 }