Upstream version 1.3.40
[profile/ivi/swig.git] / Examples / test-suite / java / director_frob_runme.java
1
2 import director_frob.*;
3 import java.lang.reflect.*;
4
5 public class director_frob_runme
6 {
7   static {
8     try {
9       System.loadLibrary("director_frob");
10     } catch (UnsatisfiedLinkError e) {
11       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);
12       System.exit(1);
13     }
14   }
15
16   public static void main(String args[])
17   {
18     Bravo foo = new Bravo();
19
20     String s = foo.abs_method();
21     if (!s.equals("Bravo::abs_method()"))
22       throw new RuntimeException( "error" );
23
24     Prims prims = new PrimsDerived();
25     java.math.BigInteger bi = prims.callull(200, 50);
26     java.math.BigInteger biCheck = new java.math.BigInteger("150");
27     if (bi.compareTo(biCheck) != 0)
28       throw new RuntimeException( "failed got:" + bi);
29   }
30 }
31
32 class PrimsDerived extends Prims {
33   PrimsDerived() {
34     super();
35   }
36   public java.math.BigInteger ull(java.math.BigInteger i, java.math.BigInteger j) {
37     return i.subtract(j);
38   }
39 }