summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--make/build-test.xml4
-rw-r--r--make/lib/TestJarsInJar.apkbin0 -> 2297 bytes
-rw-r--r--src/junit/com/jogamp/common/util/TestJarUtil.java6
-rw-r--r--src/junit/com/jogamp/junit/util/JunitTracer.java26
4 files changed, 29 insertions, 7 deletions
diff --git a/make/build-test.xml b/make/build-test.xml
index 48b8734..9f8ef25 100644
--- a/make/build-test.xml
+++ b/make/build-test.xml
@@ -86,7 +86,7 @@
</path>
<property name="junit.run.jars" value="${junit.jar}${path.separator}${ant.jar}${path.separator}${TestJarsInJar.jar}${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/>
<property name="junit.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${gluegen.root}/make/lib/TestJarsInJar.jar${path.separator}${gluegen.root}/${rootrel.build}/gluegen.jar${path.separator}${build_t}/gluegen-test.jar"/>
- <property name="junit.run.remote.apks" value="${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen.apk${path.separator}${build_t}/gluegen-test.apk"/>
+ <property name="junit.run.remote.apks" value="${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen.apk${path.separator}${build_t}/gluegen-test.apk${path.separator}${gluegen.root}/make/lib/TestJarsInJar.apk"/>
<property name="stub.includes.dir" value="stub_includes" /> <!-- NOTE: this MUST be relative for FileSet -->
@@ -298,6 +298,7 @@ rsync -rtv --delete --delete-after --delete-excluded \${line.separator}
--exclude 'android-sdk/' --exclude 'resources/' --exclude 'scripts/' \${line.separator}
--exclude 'stub_includes/' --exclude 'nbproject/' --exclude '*.log' --exclude '*.zip' --exclude '*.7z' \${line.separator}
${env.HOST_UID}@${env.HOST_IP}::${env.HOST_RSYNC_ROOT}/${gluegen.basename} ${env.TARGET_ROOT} ${line.separator}
+mkdir ${env.TARGET_ROOT}/tmp ${line.separator}
cd ${env.TARGET_ROOT}/${gluegen.basename}/${env.NODE_LABEL}/make ${line.separator}
export ${system.env.library.path}=/system/lib:${env.TARGET_ROOT}/${gluegen.basename}/${env.NODE_LABEL}/${rootrel.build}/obj:${env.TARGET_ROOT}/${gluegen.basename}/${env.NODE_LABEL}/${rootrel.build}/test/build/natives ${line.separator}
export BOOTCLASSPATH=/system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar ${line.separator}
@@ -326,6 +327,7 @@ export BOOTCLASSPATH=/system/framework/core.jar:/system/framework/bouncycastle.j
dalvikvm \${line.separator}
-Xjnigreflimit:2000 \${line.separator}
-cp ${junit.run.remote.apks} \${line.separator}
+-Djava.io.tmpdir=${env.TARGET_ROOT}/tmp \${line.separator}
-Dgluegen.root=${gluegen.root} \${line.separator}
-Drootrel.build=${rootrel.build} \${line.separator}
com.android.internal.util.WithFramework \${line.separator}
diff --git a/make/lib/TestJarsInJar.apk b/make/lib/TestJarsInJar.apk
new file mode 100644
index 0000000..10ab274
--- /dev/null
+++ b/make/lib/TestJarsInJar.apk
Binary files differ
diff --git a/src/junit/com/jogamp/common/util/TestJarUtil.java b/src/junit/com/jogamp/common/util/TestJarUtil.java
index caaac9c..ea6cebf 100644
--- a/src/junit/com/jogamp/common/util/TestJarUtil.java
+++ b/src/junit/com/jogamp/common/util/TestJarUtil.java
@@ -43,6 +43,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.os.AndroidVersion;
import com.jogamp.common.util.cache.TempCacheReg;
import com.jogamp.common.util.cache.TempFileCache;
import com.jogamp.common.util.cache.TempJarCache;
@@ -53,6 +54,11 @@ public class TestJarUtil extends JunitTracer {
@BeforeClass
public static void init() {
+ if(AndroidVersion.isAvailable) {
+ // ClassLoader -> JarURL doesn't work w/ Dalvik
+ setTestSupported(false);
+ // we allow basic TempFileCache initialization (test) ..
+ }
// may already been initialized by other test
// Assert.assertFalse(TempCacheReg.isTempFileCacheUsed());
Assert.assertTrue(TempFileCache.initSingleton());
diff --git a/src/junit/com/jogamp/junit/util/JunitTracer.java b/src/junit/com/jogamp/junit/util/JunitTracer.java
index c175601..befc2ad 100644
--- a/src/junit/com/jogamp/junit/util/JunitTracer.java
+++ b/src/junit/com/jogamp/junit/util/JunitTracer.java
@@ -28,6 +28,7 @@
package com.jogamp.junit.util;
+import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.After;
@@ -39,16 +40,23 @@ import org.junit.rules.TestName;
public abstract class JunitTracer {
@Rule public TestName _unitTestName = new TestName();
+ static volatile boolean testSupported = true;
+
+ public static void setTestSupported(boolean v) {
+ System.err.println("setTestSupported: "+v);
+ testSupported = v;
+ }
+
public final String getTestMethodName() {
return _unitTestName.getMethodName();
}
- public final String getSimpleTestName() {
- return getClass().getSimpleName()+" - "+getTestMethodName();
+ public final String getSimpleTestName(String separator) {
+ return getClass().getSimpleName()+separator+getTestMethodName();
}
- public final String getFullTestName() {
- return getClass().getName()+" - "+getTestMethodName();
+ public final String getFullTestName(String separator) {
+ return getClass().getName()+separator+getTestMethodName();
}
@BeforeClass
@@ -64,13 +72,19 @@ public abstract class JunitTracer {
@Before
public void setUp() {
- System.err.println("++++ TestCase.setUp: "+getFullTestName());
+ System.err.print("++++ TestCase.setUp: "+getFullTestName(" - "));
+ if(!testSupported) {
+ System.err.println(" - "+unsupportedTestMsg);
+ Assume.assumeTrue(testSupported);
+ }
+ System.err.println();
}
@After
public void tearDown() {
- System.err.println("++++ TestCase.tearDown: "+getFullTestName());
+ System.err.println("++++ TestCase.tearDown: "+getFullTestName(" - "));
}
+ static final String unsupportedTestMsg = "Test not supported on this platform.";
}