import source from 1.3.40
[external/swig.git] / Examples / test-suite / java / director_exception_runme.java
1
2 import director_exception.*;
3
4 public class director_exception_runme {
5
6   static {
7     try {
8       System.loadLibrary("director_exception");
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       director_exception_MyFoo a = new director_exception_MyFoo();
18       Foo b = director_exception.launder(a);
19
20       try {
21           a.pong();
22           throw new RuntimeException ( "Failed to catch exception" );
23       }
24       catch (UnsupportedOperationException e) {
25       }
26   }
27 }
28
29 class director_exception_MyFoo extends Foo {
30     public String ping() {
31         throw new UnsupportedOperationException("Foo::ping not implemented");
32     }
33 }
34