PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import director_frob.*;
  2. import java.lang.reflect.*;
  3. public class director_frob_runme
  4. {
  5. static {
  6. try {
  7. System.loadLibrary("director_frob");
  8. } catch (UnsatisfiedLinkError e) {
  9. 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);
  10. System.exit(1);
  11. }
  12. }
  13. public static void main(String args[])
  14. {
  15. Bravo foo = new Bravo();
  16. String s = foo.abs_method();
  17. if (!s.equals("Bravo::abs_method()"))
  18. throw new RuntimeException( "error" );
  19. Prims prims = new PrimsDerived();
  20. java.math.BigInteger bi = prims.callull(200, 50);
  21. java.math.BigInteger biCheck = new java.math.BigInteger("150");
  22. if (bi.compareTo(biCheck) != 0)
  23. throw new RuntimeException( "failed got:" + bi);
  24. }
  25. }
  26. class PrimsDerived extends Prims {
  27. PrimsDerived() {
  28. super();
  29. }
  30. public java.math.BigInteger ull(java.math.BigInteger i, java.math.BigInteger j) {
  31. return i.subtract(j);
  32. }
  33. }