aboutsummaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp
diff options
context:
space:
mode:
Diffstat (limited to 'src/junit/com/jogamp')
-rw-r--r--src/junit/com/jogamp/common/util/TestJarUtil.java6
-rw-r--r--src/junit/com/jogamp/junit/util/JunitTracer.java26
2 files changed, 26 insertions, 6 deletions
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.";
}