/trunk/Examples/test-suite/java/director_frob_runme.java
Java | 39 lines | 33 code | 6 blank | 0 comment | 3 complexity | b190e1261561c3e204265c400c1a0aee MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- import director_frob.*;
- import java.lang.reflect.*;
- public class director_frob_runme
- {
- static {
- try {
- System.loadLibrary("director_frob");
- } 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 args[])
- {
- Bravo foo = new Bravo();
- String s = foo.abs_method();
- if (!s.equals("Bravo::abs_method()"))
- throw new RuntimeException( "error" );
- Prims prims = new PrimsDerived();
- java.math.BigInteger bi = prims.callull(200, 50);
- java.math.BigInteger biCheck = new java.math.BigInteger("150");
- if (bi.compareTo(biCheck) != 0)
- throw new RuntimeException( "failed got:" + bi);
- }
- }
- class PrimsDerived extends Prims {
- PrimsDerived() {
- super();
- }
- public java.math.BigInteger ull(java.math.BigInteger i, java.math.BigInteger j) {
- return i.subtract(j);
- }
- }