aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2011-12-02 03:50:52 +0100
committerSven Gothel <sgothel@jausoft.com>2011-12-02 03:50:52 +0100
commitc9bd1073d4fee2864162ac6f82380d538d33f322 (patch)
treee8707b7ec6dc800836908ef80242d0b5341e1953 /src/test/com/jogamp
parent65dc12ecbaa28f7643ce406860b3f47f53bc29d5 (diff)
Test AWT Translucency: Use ReflectionUtil to use com.sun.awt.AWTUtilities, n/a on some AWT impl.
Diffstat (limited to 'src/test/com/jogamp')
-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
2 files changed, 20 insertions, 4 deletions
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];