Upstream version 1.3.40
[profile/ivi/swig.git] / Examples / test-suite / java / director_default_runme.java
1
2 import director_default.*;
3
4 public class director_default_runme {
5
6   static {
7     try {
8       System.loadLibrary("director_default");
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_default_MyFoo a = new director_default_MyFoo();
18       a = new director_default_MyFoo(10);
19     }
20
21     director_default_MyFoo a = new director_default_MyFoo();
22     if (!a.GetMsg().equals("director_default_MyFoo-default")) {
23       throw new RuntimeException ( "Test 1 failed" );
24     }
25     if (!a.GetMsg("boo").equals("director_default_MyFoo-boo")) {
26       throw new RuntimeException ( "Test 2 failed" );
27     }
28
29     Foo b = new Foo();
30     if (!b.GetMsg().equals("Foo-default")) {
31       throw new RuntimeException ( "Test 1 failed" );
32     }
33     if (!b.GetMsg("boo").equals("Foo-boo")) {
34       throw new RuntimeException ( "Test 2 failed" );
35     }
36
37   }
38 }
39
40 class director_default_MyFoo extends Foo {
41     public director_default_MyFoo() {
42       super();
43     }
44     public director_default_MyFoo(int i) {
45       super(i);
46     }
47     public String Msg(String msg) { 
48       return "director_default_MyFoo-" + msg; 
49     }
50 }
51