summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-12-02 03:50:52 +0100
committerSven Gothel <[email protected]>2011-12-02 03:50:52 +0100
commitc9bd1073d4fee2864162ac6f82380d538d33f322 (patch)
treee8707b7ec6dc800836908ef80242d0b5341e1953
parent65dc12ecbaa28f7643ce406860b3f47f53bc29d5 (diff)
Test AWT Translucency: Use ReflectionUtil to use com.sun.awt.AWTUtilities, n/a on some AWT impl.
-rwxr-xr-xmake/scripts/tests.sh4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java12
3 files changed, 22 insertions, 6 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index f6e8da2b7..a465fe4fe 100755
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -223,7 +223,7 @@ function testswt() {
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWTAnalyzeBug455 $*
#testawt com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsGLJPanelAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.texture.TestTexture01AWT
-testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug461OffscreenSupersamplingSwingAWT
+#testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug461OffscreenSupersamplingSwingAWT
#testawt com.jogamp.opengl.test.junit.jogl.texture.TestGrayTextureFromFileAWTBug417
#testawt com.jogamp.opengl.test.junit.jogl.swt.TestSWTAWT01GLn $*
#testawt com.jogamp.opengl.test.junit.jogl.glu.TestBug463ScaleImageMemoryAWT $*
@@ -251,7 +251,7 @@ testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug461OffscreenSupersamplingSw
#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParenting03AWT $*
#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParentingFocusTraversal01AWT $*
#testawt com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01AWT $*
-#testawt com.jogamp.opengl.test.junit.newt.parenting.TestTranslucentParentingAWT $*
+testawt com.jogamp.opengl.test.junit.newt.parenting.TestTranslucentParentingAWT $*
#testawt com.jogamp.opengl.test.junit.newt.TestCloseNewtAWT
#testawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleAWT $*
#testawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleNEWT $*
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
index e22163847..8e720965c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
@@ -51,6 +51,7 @@ import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.Animator;
@@ -80,8 +81,15 @@ public class TestTranslucencyAWT extends UITestCase {
boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
boolean capable2 = false;
try {
- capable2 = com.sun.awt.AWTUtilities.isTranslucencyCapable(config);
- } catch (Exception e) {}
+ capable2 = ((Boolean)ReflectionUtil.callStaticMethod(
+ "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
+ new Class<?>[] { GraphicsConfiguration.class },
+ new Object[] { config } ,
+ GraphicsConfiguration.class.getClassLoader())).booleanValue();
+ System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) passed: "+capable2);
+ } catch (RuntimeException re) {
+ System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) failed: "+re.getMessage());
+ }
System.err.println(i+":"+j+" "+config+", "+tcm+", capable "+capable1+"/"+capable2);
if(capable1&&capable2) {
gc=configs[j];
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
index 86a76f9ff..57b8517a6 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
@@ -50,6 +50,7 @@ import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import com.jogamp.common.util.ReflectionUtil;
import com.jogamp.newt.Window;
import com.jogamp.newt.awt.NewtCanvasAWT;
import com.jogamp.newt.opengl.GLWindow;
@@ -89,8 +90,15 @@ public class TestTranslucentParentingAWT extends UITestCase {
boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
boolean capable2 = false;
try {
- capable2 = com.sun.awt.AWTUtilities.isTranslucencyCapable(config);
- } catch (Exception e) {}
+ capable2 = ((Boolean)ReflectionUtil.callStaticMethod(
+ "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
+ new Class<?>[] { GraphicsConfiguration.class },
+ new Object[] { config } ,
+ GraphicsConfiguration.class.getClassLoader())).booleanValue();
+ System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) passed: "+capable2);
+ } catch (RuntimeException re) {
+ System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) failed: "+re.getMessage());
+ }
System.err.println(i+":"+j+" "+config+", "+tcm+", capable "+capable1+"/"+capable2);
if(capable1&&capable2) {
gc=configs[j];