/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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
1 2import default_constructor.*; 3 4public class default_constructor_runme { 5 static { 6 try { 7 System.loadLibrary("default_constructor"); 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 14 public static void main(String argv[]) 15 { 16 // calling protected destructor test 17 try { 18 G g = new G(); 19 g.delete(); 20 throw new RuntimeException("Protected destructor exception should have been thrown"); 21 } catch (UnsupportedOperationException e) { 22 } 23 24 // calling private destructor test 25 try { 26 FFF f = new FFF(); 27 f.delete(); 28 throw new RuntimeException("Private destructor exception should have been thrown"); 29 } catch (UnsupportedOperationException e) { 30 } 31 } 32}