PageRenderTime 19ms CodeModel.GetById 9ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/java/director_default_runme.java

#
Java | 51 lines | 42 code | 9 blank | 0 comment | 4 complexity | 271786f8a8bb27b76502a7afa7eda4d8 MD5 | raw file
 1
 2import director_default.*;
 3
 4public 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
40class 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