PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Java | 39 lines | 33 code | 6 blank | 0 comment | 3 complexity | b190e1261561c3e204265c400c1a0aee MD5 | raw file
 1
 2import director_frob.*;
 3import java.lang.reflect.*;
 4
 5public 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
32class 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}