From 3b4145fc7829fe7d6023d9da5e7497f26c7df863 Mon Sep 17 00:00:00 2001 From: Mark Donszelmann Date: Mon, 5 Oct 2009 11:36:11 +0200 Subject: Added test it0006-jni-3rdparty --- pom.xml | 2 +- src/it/it0006-jni-3rdparty/pom.xml | 69 +++++++++++++++++++++ .../lib/libit0003-jni-1.0-SNAPSHOT.jnilib | Bin 0 -> 8648 bytes .../share/it0003-jni-1.0-SNAPSHOT.jar | Bin 0 -> 4450 bytes .../src/test/java/HelloThirdPartyJNITest.java | 25 ++++++++ src/site/apt/HelloWorld.apt | 15 +++-- 6 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 src/it/it0006-jni-3rdparty/pom.xml create mode 100755 src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/lib/libit0003-jni-1.0-SNAPSHOT.jnilib create mode 100644 src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/share/it0003-jni-1.0-SNAPSHOT.jar create mode 100644 src/it/it0006-jni-3rdparty/src/test/java/HelloThirdPartyJNITest.java diff --git a/pom.xml b/pom.xml index 39282f7..3c81a99 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ net.sf.antcontrib cpptasks-parallel - 1.0-beta-4-parallel-3-SNAPSHOT + 1.0-beta-4-parallel-4 bcel diff --git a/src/it/it0006-jni-3rdparty/pom.xml b/src/it/it0006-jni-3rdparty/pom.xml new file mode 100644 index 0000000..65602e6 --- /dev/null +++ b/src/it/it0006-jni-3rdparty/pom.xml @@ -0,0 +1,69 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.nar + it-parent + 1.0-SNAPSHOT + ../it-parent/pom.xml + + + it0006-jni-3rdparty + nar + + Maven NAR Third Party JNI + 1.0-SNAPSHOT + + Java class that uses a 3rd party JNI and its library + + http://maven.apache.org/ + + + + integration-test + + + maven-nar-plugin + true + + + + jni + + + + + + maven-surefire-plugin + + true + + + + + diff --git a/src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/lib/libit0003-jni-1.0-SNAPSHOT.jnilib b/src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/lib/libit0003-jni-1.0-SNAPSHOT.jnilib new file mode 100755 index 0000000..b7e52a4 Binary files /dev/null and b/src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/lib/libit0003-jni-1.0-SNAPSHOT.jnilib differ diff --git a/src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/share/it0003-jni-1.0-SNAPSHOT.jar b/src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/share/it0003-jni-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..f2e29f5 Binary files /dev/null and b/src/it/it0006-jni-3rdparty/src/nar/resources/aol/x86_64-MacOSX-g++/share/it0003-jni-1.0-SNAPSHOT.jar differ diff --git a/src/it/it0006-jni-3rdparty/src/test/java/HelloThirdPartyJNITest.java b/src/it/it0006-jni-3rdparty/src/test/java/HelloThirdPartyJNITest.java new file mode 100644 index 0000000..3ef06f3 --- /dev/null +++ b/src/it/it0006-jni-3rdparty/src/test/java/HelloThirdPartyJNITest.java @@ -0,0 +1,25 @@ +import junit.framework.*; + +import com.mycompany.mypackage.HelloWorldJNI; + +public class HelloThirdPartyJNITest extends TestCase { + + public HelloThirdPartyJNITest(String name) { + super(name); + } + + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testNativeHelloThirdPartyJNI() throws Exception { + HelloWorldJNI app = new HelloWorldJNI(); + + this.assertEquals( "Hello NAR World!", app.sayHello() ); + } +} + diff --git a/src/site/apt/HelloWorld.apt b/src/site/apt/HelloWorld.apt index 08138d3..2320979 100644 --- a/src/site/apt/HelloWorld.apt +++ b/src/site/apt/HelloWorld.apt @@ -19,15 +19,20 @@ There are also some unit test which are run and call the same method. [] - [jni] A C routine called from Java and a Java unit test. + [jni] A C routine called from Java. [java-dep-jni] A java project which depends on "jni". - [helloworldstaticjni] A C routine called from Java statically linked with the C-runtime library and a Java unit test. + [jni-static] A C routine called from Java statically linked with the C-runtime library. - [hellothirdpartyjni] A third party JNI library called from Java. - The third party library is "jni" and is added as resource to the project in the - form of a JNI library and a corresponding jar file. A Java unit test is provided. + [jni-3rdparty] A third party JNI library called from Java. + The third party library is the "jni" from the example above and is added as resource to the project in the + form of a JNI library and a corresponding jar file. The "jni" lib is currently provided for the following + platforms: + + * x86_64-MacOSX-g++ + + [] [] -- cgit v1.2.3