~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Examples/test-suite/java/director_string_runme.java

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
import director_string.*;
 
3
 
 
4
public class director_string_runme {
 
5
 
 
6
  static {
 
7
    try {
 
8
      System.loadLibrary("director_string");
 
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_string_B b = new director_string_B("hello");
 
18
 
 
19
    String s;
 
20
 
 
21
    s = b.call_get_first();
 
22
    if (!s.equals("director_string_B.get_first")) throw new RuntimeException("call_get_first() failed");
 
23
 
 
24
    s = b.call_get(0);
 
25
    if (!s.equals("director_string_B.get")) throw new RuntimeException("get(0) failed");
 
26
//    if (!s.equals("director_string_B.get: hello")) throw new RuntimeException("get(0) failed");
 
27
  }
 
28
}
 
29
 
 
30
class director_string_B extends A {
 
31
    public director_string_B(String first) {
 
32
      super(first);
 
33
    }
 
34
    public String get_first() {
 
35
      return "director_string_B.get_first";
 
36
    }
 
37
  
 
38
    public String get(int n) {
 
39
      return "director_string_B.get";
 
40
// recursive call problem (needs fixing)
 
41
//      return "director_string_B.get: " + super.get(n);
 
42
    }
 
43
}
 
44