/tags/rel-1-3-29/SWIG/Examples/test-suite/java/default_constructor_runme.java

# · Java · 32 lines · 26 code · 4 blank · 2 comment · 0 complexity · a3f504086a818c2be18df5f1a6052a9e MD5 · raw file

  1. import default_constructor.*;
  2. public class default_constructor_runme {
  3. static {
  4. try {
  5. System.loadLibrary("default_constructor");
  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. // calling protected destructor test
  14. try {
  15. G g = new G();
  16. g.delete();
  17. throw new RuntimeException("Protected destructor exception should have been thrown");
  18. } catch (UnsupportedOperationException e) {
  19. }
  20. // calling private destructor test
  21. try {
  22. FFF f = new FFF();
  23. f.delete();
  24. throw new RuntimeException("Private destructor exception should have been thrown");
  25. } catch (UnsupportedOperationException e) {
  26. }
  27. }
  28. }