aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-31 02:24:41 +0200
committerSven Gothel <[email protected]>2011-08-31 02:24:41 +0200
commitfdd0f9cc3c6d9843b128e09ed6f1cbea1d812512 (patch)
tree41362bd2a636290ecc8372b4e13d29d8560e4434 /src
parent71d691db8c631cb2b2fac6e61a1027d3d30008a2 (diff)
UnitTests AWT: Remove GLProfile.initSingleton(true) and ensure AWT-dispose happens on AWT-EDT
We will use the default implicit call of GLProfile.initSingleton(false). (This is the same case as for AWT applets as.) We shall create extra test cases for AWT + GLProfile.initSingleton(true) to test it's stability. However .. to nail down our test instability w/ AMD's fglrx driver we move to the default behavior.
Diffstat (limited to 'src')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java43
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWTBug450.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java31
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java23
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java1
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java1
27 files changed, 70 insertions, 79 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
index fe7475448..8ee182939 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
@@ -28,7 +28,6 @@
package com.jogamp.opengl.test.junit.jogl.acore;
-import javax.media.opengl.FPSCounter;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLPbuffer;
@@ -44,6 +43,7 @@ import java.awt.Frame;
import javax.swing.SwingUtilities;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -56,7 +56,6 @@ public class TestSharedContextListAWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
glp = GLProfile.getDefault();
Assert.assertNotNull(glp);
caps = new GLCapabilities(glp);
@@ -110,15 +109,15 @@ public class TestSharedContextListAWT extends UITestCase {
public void test01() throws InterruptedException {
initShared();
- Frame f1 = createFrame(0, 0, true);
- Frame f2 = createFrame(width, 0, true);
- Frame f3 = createFrame(0, height, false);
+ final Frame f1 = createFrame(0, 0, true);
+ final Frame f2 = createFrame(width, 0, true);
+ final Frame f3 = createFrame(0, height, false);
Animator animator = new Animator();
- GLCanvas glc1 = runTestGL(f1, animator, 0, 0, true, false);
- GLCanvas glc2 = runTestGL(f2, animator, width, 0, true, false);
- GLCanvas glc3 = runTestGL(f3, animator, 0, height, false, true);
+ final GLCanvas glc1 = runTestGL(f1, animator, 0, 0, true, false);
+ final GLCanvas glc2 = runTestGL(f2, animator, width, 0, true, false);
+ final GLCanvas glc3 = runTestGL(f3, animator, 0, height, false, true);
animator.setUpdateFPSFrames(1, null);
animator.start();
@@ -128,17 +127,27 @@ public class TestSharedContextListAWT extends UITestCase {
animator.stop();
// here we go again: On AMD/X11 the create/destroy sequence must be the same
- // even though this is agains the chicken/egg logic here ..
+ // even though this is agains the chicken/egg logic
releaseShared();
- f1.dispose();
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc1, false));
-
- f2.dispose();
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc2, false));
-
- f3.dispose();
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc3, false));
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ try {
+ f1.dispose();
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc1, false));
+ f2.dispose();
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc2, false));
+ f3.dispose();
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc3, false));
+ } catch (Throwable t) {
+ throw new RuntimeException(t);
+ }
+ }});
+ } catch( Throwable throwable ) {
+ throwable.printStackTrace();
+ Assume.assumeNoException( throwable );
+ }
// see above ..
//releaseShared();
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 4a6f6ac3b..97c41ba31 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
@@ -52,7 +52,6 @@ public class TestAWT01GLn extends UITestCase {
@BeforeClass
public static void startup() {
- GLProfile.initSingleton(true);
System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
index 535f0e99e..f83c8c03d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
@@ -45,11 +45,6 @@ public class TestAWT02WindowClosing extends UITestCase {
static long durationPerTest = 200; // ms
- @BeforeClass
- public static void initClass() {
- GLProfile.initSingleton(true);
- }
-
@Test
public void test01WindowClosing() throws InterruptedException {
Frame frame = new Frame();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
index c837cb15e..4dabb67e4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
@@ -58,7 +58,6 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
@BeforeClass
public static void startup() {
- GLProfile.initSingleton(true);
System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
index 6de9e9788..c89ce43f7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
@@ -44,7 +44,6 @@ public class TestBug460GLCanvasNPEAWT {
@Test
public void testIncompleteGLCanvasNPE() {
- GLProfile.initSingleton(false);
GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
GLCanvas glc = new GLCanvas(caps);
// GLDrawableFactory factory = glc.getFactory(); // null ok: not realized
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
index b547a8eea..b6192b28a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
@@ -59,7 +59,6 @@ public class TestSwingAWT01GLn extends UITestCase {
@BeforeClass
public static void startup() {
- GLProfile.initSingleton(true);
System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
index bde9f42ed..ab369a959 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
@@ -71,7 +71,6 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
glp = GLProfile.get(GLProfile.GL2);
Assert.assertNotNull(glp);
caps = new GLCapabilities(glp);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
index 274b2cf36..8ab641267 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
@@ -53,7 +53,6 @@ public class TestGearsAWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
glp = GLProfile.getDefault();
Assert.assertNotNull(glp);
width = 512;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
index 1b07e6523..59d54c3dd 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
@@ -53,7 +53,6 @@ public class TestGearsGLJPanelAWT extends UITestCase {
@BeforeClass
public static void initClass() {
- // redundant, since implicit (false): GLProfile.initSingleton(false);
glp = GLProfile.getDefault();
Assert.assertNotNull(glp);
width = 512;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWTBug450.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWTBug450.java
index 6841dcf62..7a4645b80 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWTBug450.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWTBug450.java
@@ -68,7 +68,6 @@ public class TestGearsGLJPanelAWTBug450 extends UITestCase {
@BeforeClass
public static void initClass() {
- // redundant, since implicit (false): GLProfile.initSingleton(false);
glp = GLProfile.getDefault();
Assert.assertNotNull(glp);
width = 512;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
index 46691c209..e05c588a4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
@@ -51,7 +51,6 @@ public class TestGearsNewtAWTWrapper extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
glp = GLProfile.getDefault();
Assert.assertNotNull(glp);
width = 512;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
index 44ad797c1..d133ebde5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
@@ -30,7 +30,6 @@ package com.jogamp.opengl.test.junit.jogl.glsl;
import com.jogamp.opengl.test.junit.util.UITestCase;
import com.jogamp.opengl.util.Animator;
-import javax.media.opengl.FPSCounter;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
@@ -41,6 +40,7 @@ import javax.media.opengl.awt.GLCanvas;
import java.awt.Frame;
import org.junit.Assert;
+import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.AfterClass;
import org.junit.Test;
@@ -50,10 +50,6 @@ import org.junit.Test;
* This bug is Windows-only; it works on Mac OS X and CentOS.
*/
public class TestShaderCompilationBug459AWT extends UITestCase {
- static {
- GLProfile.initSingleton(true);
- }
- static GLProfile glp;
static int width, height;
static long duration = 500; // ms
/** Exception in shader code sets this, since it won't bubble up through AWT. */
@@ -61,8 +57,6 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
@BeforeClass
public static void initClass() {
- glp = GLProfile.getDefault();
- Assert.assertNotNull(glp);
width = 512;
height = 512;
}
@@ -73,7 +67,7 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
@Test
public void compileShader() throws InterruptedException {
- GLProfile glp = GLProfile.get("GL2GL3");
+ GLProfile glp = GLProfile.get(GLProfile.GL2GL3);
GLCapabilities caps = new GLCapabilities(glp);
// commenting out this line makes it work
caps.setStencilBits(8);
@@ -81,10 +75,10 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
// commenting in this line also makes it work
//caps.setSampleBuffers(true);
- Frame frame = new Frame("Bug 459 shader compilation test");
+ final Frame frame = new Frame("Bug 459 shader compilation test");
Assert.assertNotNull(frame);
- GLCanvas glCanvas = new GLCanvas(caps);
+ final GLCanvas glCanvas = new GLCanvas(caps);
Assert.assertNotNull(glCanvas);
frame.add(glCanvas);
frame.setSize(512, 512);
@@ -152,12 +146,17 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
animator.stop();
Assert.assertEquals(false, animator.isAnimating());
- frame.setVisible(false);
- Assert.assertEquals(false, frame.isVisible());
- frame.remove(glCanvas);
- frame.dispose();
- frame=null;
- glCanvas=null;
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ frame.remove(glCanvas);
+ frame.dispose();
+ }});
+ } catch( Throwable throwable ) {
+ throwable.printStackTrace();
+ Assume.assumeNoException( throwable );
+ }
}
public static void main(String args[]) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
index 6c808f88d..64c1f15ce 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
@@ -167,6 +167,8 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): Before JOGL init");
+ // just to trigger JOGL initialization at a well defined point ..
+ // ofc it's not the first UI command
GLProfile.initSingleton(false);
System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): End Pre-JOGL-Swing");
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java
index 2b12cdd23..595e6fb31 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAWT01GLn.java
@@ -72,7 +72,6 @@ public class TestSWTAWT01GLn extends UITestCase {
@BeforeClass
public static void startup() {
- GLProfile.initSingleton( true );
System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java
index 82cd91718..8f38ac604 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestGrayTextureFromFileAWTBug417.java
@@ -65,7 +65,6 @@ public class TestGrayTextureFromFileAWTBug417 extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
glp = GLProfile.get(GLProfile.GL2GL3);
Assert.assertNotNull(glp);
caps = new GLCapabilities(glp);
@@ -85,9 +84,8 @@ public class TestGrayTextureFromFileAWTBug417 extends UITestCase {
@Test
public void test1() throws InterruptedException {
- GLCanvas glCanvas = new GLCanvas(caps);
-
- Frame frame = new Frame("Texture Test");
+ final GLCanvas glCanvas = new GLCanvas(caps);
+ final Frame frame = new Frame("Texture Test");
Assert.assertNotNull(frame);
frame.add(glCanvas);
frame.setSize( 256, 128 );
@@ -118,12 +116,17 @@ public class TestGrayTextureFromFileAWTBug417 extends UITestCase {
Thread.sleep(500); // 500 ms
animator.stop();
- frame.setVisible(false);
- frame.remove(glCanvas);
- glCanvas=null;
- Assert.assertNotNull(frame);
- frame.dispose();
- frame=null;
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ frame.remove(glCanvas);
+ frame.dispose();
+ }});
+ } catch( Throwable throwable ) {
+ throwable.printStackTrace();
+ Assume.assumeNoException( throwable );
+ }
}
public static void main(String args[]) throws IOException {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java
index bd83799d4..49057643e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/texture/TestTexture01AWT.java
@@ -49,6 +49,7 @@ import java.awt.image.BufferedImage;
import java.io.IOException;
import org.junit.Assert;
import org.junit.After;
+import org.junit.Assume;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -60,7 +61,6 @@ public class TestTexture01AWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
glp = GLProfile.get(GLProfile.GL2GL3);
Assert.assertNotNull(glp);
caps = new GLCapabilities(glp);
@@ -103,9 +103,8 @@ public class TestTexture01AWT extends UITestCase {
@Test
public void test1() throws InterruptedException {
- GLCanvas glCanvas = new GLCanvas(caps);
-
- Frame frame = new Frame("Texture Test");
+ final GLCanvas glCanvas = new GLCanvas(caps);
+ final Frame frame = new Frame("Texture Test");
Assert.assertNotNull(frame);
frame.add(glCanvas);
frame.setSize(512, 512);
@@ -121,12 +120,17 @@ public class TestTexture01AWT extends UITestCase {
Thread.sleep(500); // 500 ms
animator.stop();
- frame.setVisible(false);
- frame.remove(glCanvas);
- glCanvas=null;
- Assert.assertNotNull(frame);
- frame.dispose();
- frame=null;
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ frame.remove(glCanvas);
+ frame.dispose();
+ }});
+ } catch( Throwable throwable ) {
+ throwable.printStackTrace();
+ Assume.assumeNoException( throwable );
+ }
}
public static void main(String args[]) throws IOException {
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
index f73848c2b..ba8c2f731 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
@@ -55,7 +55,6 @@ public class TestEventSourceNotAWTBug extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
}
@Test
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java
index 4a8be69ba..4de693c33 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus01SwingAWTRobot.java
@@ -65,7 +65,6 @@ public class TestFocus01SwingAWTRobot extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
width = 640;
height = 480;
glCaps = new GLCapabilities(null);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
index bea9a1f2f..ac6300729 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
@@ -74,7 +74,6 @@ public class TestFocus02SwingAWTRobot extends UITestCase {
f.dispose();
f=null;
- GLProfile.initSingleton(false);
glCaps = new GLCapabilities(null);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
index b57215186..b997cd393 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
@@ -67,7 +67,6 @@ public class TestListenerCom01AWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
width = 640;
height = 480;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
index a6090ae93..d52dbc2ef 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
@@ -70,7 +70,6 @@ public class TestParenting01aAWT extends UITestCase {
@BeforeClass
public static void initClass() throws InterruptedException {
- GLProfile.initSingleton(true);
width = 640;
height = 480;
glCaps = new GLCapabilities(null);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
index bfa2fba87..28a48d574 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
@@ -70,7 +70,6 @@ public class TestParenting01bAWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
width = 640;
height = 480;
glCaps = new GLCapabilities(null);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
index 5240dd37d..5052f0515 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
@@ -68,7 +68,6 @@ public class TestParenting01cAWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
width = 640;
height = 480;
glCaps = new GLCapabilities(null);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
index ed6f9ea75..74a1cdb42 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
@@ -62,7 +62,6 @@ public class TestParenting01cSwingAWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
width = 640;
height = 480;
glCaps = new GLCapabilities(null);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
index 32e334076..5e7316bde 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
@@ -56,7 +56,6 @@ public class TestParenting02AWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
width = 640;
height = 480;
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
index 77ec18096..9ad592c02 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
@@ -61,7 +61,6 @@ public class TestParenting03AWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
size = new Dimension(400,200);
glCaps = new GLCapabilities(null);
glCaps.setAlphaBits(8);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java
index eb556d5ee..04663bfb2 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03bAWT.java
@@ -61,7 +61,6 @@ public class TestParenting03bAWT extends UITestCase {
@BeforeClass
public static void initClass() {
- GLProfile.initSingleton(true);
size = new Dimension(400,200);
glCaps = new GLCapabilities(null);
}