From b8b013e30eb763aca299c8eee97a992a4ebe60d2 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 29 Dec 2005 23:58:17 +0000 Subject: [PATCH] runtime test for Java added git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8124 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../java/typemap_namespace_runme.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 SWIG/Examples/test-suite/java/typemap_namespace_runme.java diff --git a/SWIG/Examples/test-suite/java/typemap_namespace_runme.java b/SWIG/Examples/test-suite/java/typemap_namespace_runme.java new file mode 100644 index 000000000..eddb896cf --- /dev/null +++ b/SWIG/Examples/test-suite/java/typemap_namespace_runme.java @@ -0,0 +1,21 @@ +import typemap_namespace.*; + +public class typemap_namespace_runme { + + static { + try { + System.loadLibrary("typemap_namespace"); + } 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 argv[]) throws Throwable + { + if (!typemap_namespace.test1("hello").equals("hello")) + throw new RuntimeException("test1 failed"); + if (!typemap_namespace.test2("hello").equals("hello")) + throw new RuntimeException("test2 failed"); + } +}