swig/Examples/test-suite/java/director_string_runme.java
William S Fulton 4cff098887 string reference test fixes
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7106 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-03-29 20:47:52 +00:00

41 lines
897 B
Java

import director_string.*;
public class director_string_runme {
static {
try {
System.loadLibrary("director_string");
} catch (UnsatisfiedLinkError e) {
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);
System.exit(1);
}
}
public static void main(String argv[]) {
B b = new B("hello");
String s;
s = b.call_get_first();
if (!s.equals("B.get_first")) throw new RuntimeException("call_get_first() failed");
s = b.call_get(0);
if (!s.equals("B.get: hello")) throw new RuntimeException("get(0) failed");
}
}
class B extends A {
public B(String first) {
super(first);
}
public String get_first() {
return "B.get_first";
}
public String get(int n) {
return "B.get: " + super.get(n);
}
}