aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-08-18 00:45:13 +0200
committerSven Gothel <[email protected]>2012-08-18 00:45:13 +0200
commit5a5c2bc7a113906453e0de6f0403f394acdb9a4f (patch)
tree8154f5942da8da946b2daaced0640b525dec0d9b /src/test/com/jogamp
parentb255e569c5197aa60255a6141960a39a827222c4 (diff)
Fix GLCanvas's JAWTWindow reference ; Add ES2 test in TestAWT01GLn ; Ubuntu 12.04/Pandaboard(Omap4, PowerVR SGX 540) 103/108 tests passed (before freeze) of 124 total
Fix GLCanvas's JAWTWindow reference - drawable.getNativeSurface() may not be a JAWTWindow due to our EGL WrappedSurface. Hence store the created JAWTWindow reference locally. Add ES2 test in TestAWT01GLn - test EGL/ES2 w/ AWT GLCanvas Ubuntu 12.04/Pandaboard(Omap4, PowerVR SGX 540): 103/108 tests passed (before freeze) of 124 total - machine freezes around test 108 .. - new passed unit test high for ES2 incl. AWT tests
Diffstat (limited to 'src/test/com/jogamp')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
index 64a1a0138..e1048c2f8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
@@ -40,49 +40,23 @@ import java.awt.Frame;
import org.junit.Assert;
import org.junit.Assume;
-import org.junit.Before;
import org.junit.BeforeClass;
-import org.junit.After;
import org.junit.Test;
public class TestAWT01GLn extends UITestCase {
- Frame frame=null;
- GLCanvas glCanvas=null;
-
@BeforeClass
public static void startup() {
System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
}
- @Before
- public void init() {
- frame = new Frame("Texture Test");
- Assert.assertNotNull(frame);
- }
-
- @After
- public void release() {
- Assert.assertNotNull(frame);
- Assert.assertNotNull(glCanvas);
- try {
- javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
- public void run() {
- frame.setVisible(false);
- frame.remove(glCanvas);
- frame.dispose();
- }});
- } catch (Throwable t) {
- t.printStackTrace();
- Assume.assumeNoException(t);
- }
- frame=null;
- glCanvas=null;
- }
-
protected void runTestGL(GLCapabilities caps) throws InterruptedException {
- glCanvas = new GLCanvas(caps);
+ final Frame frame = new Frame("Texture Test");
+ Assert.assertNotNull(frame);
+
+ final GLCanvas glCanvas = new GLCanvas(caps);
Assert.assertNotNull(glCanvas);
+
glCanvas.addGLEventListener(new GearsES2());
frame.add(glCanvas);
@@ -110,6 +84,18 @@ public class TestAWT01GLn extends UITestCase {
Thread.sleep(500); // 500 ms
animator.stop();
+
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ frame.remove(glCanvas);
+ frame.dispose();
+ }});
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Assume.assumeNoException(t);
+ }
}
@Test
@@ -136,6 +122,18 @@ public class TestAWT01GLn extends UITestCase {
}
}
+ @Test
+ public void test02ES2() throws InterruptedException {
+ if(GLProfile.isAvailable(GLProfile.GLES2)) {
+ GLProfile glprofile = GLProfile.get(GLProfile.GLES2);
+ System.out.println( "GLProfile GLES2: " + glprofile );
+ GLCapabilities caps = new GLCapabilities(glprofile);
+ runTestGL(caps);
+ } else {
+ System.out.println("GLES2 n/a");
+ }
+ }
+
public static void main(String args[]) {
org.junit.runner.JUnitCore.main(TestAWT01GLn.class.getName());
}