PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Java | 51 lines | 42 code | 9 blank | 0 comment | 4 complexity | 271786f8a8bb27b76502a7afa7eda4d8 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. import director_default.*;
  2. public class director_default_runme {
  3. static {
  4. try {
  5. System.loadLibrary("director_default");
  6. } catch (UnsatisfiedLinkError e) {
  7. 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);
  8. System.exit(1);
  9. }
  10. }
  11. public static void main(String argv[]) {
  12. {
  13. director_default_MyFoo a = new director_default_MyFoo();
  14. a = new director_default_MyFoo(10);
  15. }
  16. director_default_MyFoo a = new director_default_MyFoo();
  17. if (!a.GetMsg().equals("director_default_MyFoo-default")) {
  18. throw new RuntimeException ( "Test 1 failed" );
  19. }
  20. if (!a.GetMsg("boo").equals("director_default_MyFoo-boo")) {
  21. throw new RuntimeException ( "Test 2 failed" );
  22. }
  23. Foo b = new Foo();
  24. if (!b.GetMsg().equals("Foo-default")) {
  25. throw new RuntimeException ( "Test 1 failed" );
  26. }
  27. if (!b.GetMsg("boo").equals("Foo-boo")) {
  28. throw new RuntimeException ( "Test 2 failed" );
  29. }
  30. }
  31. }
  32. class director_default_MyFoo extends Foo {
  33. public director_default_MyFoo() {
  34. super();
  35. }
  36. public director_default_MyFoo(int i) {
  37. super(i);
  38. }
  39. public String Msg(String msg) {
  40. return "director_default_MyFoo-" + msg;
  41. }
  42. }