summaryrefslogtreecommitdiffstats
path: root/src/test/com/jogamp/opengl
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-02-28 20:17:53 +0100
committerSven Gothel <[email protected]>2013-02-28 20:17:53 +0100
commit9a5e03cc9e028422f8e7c85e875f6db4bedeaaff (patch)
tree4b070334ee85af375a1cb592ab084f6556e20d9e /src/test/com/jogamp/opengl
parent33eb58fc25b0e44666f72e5a2abf6e040efba8bf (diff)
All AWT Related Unit Tests: Call AWT 'frame.setVisible(..)' and 'frame.pack()' on AWT-EDT - Use dedicated test TestBug572AWT for testing otherwise.
Diffstat (limited to 'src/test/com/jogamp/opengl')
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java24
-rw-r--r--src/test/com/jogamp/opengl/test/bugs/Issue344Base.java11
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java17
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java7
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java11
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWTCardLayoutAnimatorStartStopBug532.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java14
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java55
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java101
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java14
-rwxr-xr-xsrc/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java11
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java7
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java24
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java11
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java13
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java30
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java17
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java22
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java10
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java5
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java8
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java4
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java9
38 files changed, 331 insertions, 212 deletions
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
index 9bf492e0f..66889e9ed 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
@@ -13,9 +13,16 @@ public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLayout(new BorderLayout());
- setSize(600, 600);
- setLocation(40, 40);
- setVisible(true);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ setSize(600, 600);
+ setLocation(40, 40);
+ setVisible(true);
+ } } );
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
+ }
GLProfile glp = GLProfile.get(GLProfile.GL2);
GLCapabilities caps = new GLCapabilities(glp);
@@ -29,8 +36,15 @@ public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
}
public static void main(String[] args) {
- Bug427GLJPanelTest1 demo = new Bug427GLJPanelTest1();
- demo.setVisible(true);
+ final Bug427GLJPanelTest1 demo = new Bug427GLJPanelTest1();
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ demo.setVisible(true);
+ } } );
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
+ }
}
public void display(GLAutoDrawable drawable) {
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
index 9b0a4c6a0..2a7afabff 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
@@ -36,7 +36,7 @@ public abstract class Issue344Base implements GLEventListener
protected abstract String getText();
protected void run(String[] args) {
- Frame frame = new Frame(getClass().getName());
+ final Frame frame = new Frame(getClass().getName());
frame.setLayout(new BorderLayout());
GLCanvas canvas = new GLCanvas();
@@ -53,7 +53,14 @@ public abstract class Issue344Base implements GLEventListener
}).start();
}
});
- frame.setVisible(true);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(true);
+ } } );
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
+ }
}
public void init(GLAutoDrawable drawable)
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
index 8df54988f..89de086bb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
@@ -29,19 +29,16 @@ public class TestAWTCloseX11DisplayBug565 {
}
GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
- Frame frame = new Frame( "AWT Resource X11 Leak - #" + j );
+ final Frame frame = new Frame( "AWT Resource X11 Leak - #" + j );
- GLCanvas glCanvas = new GLCanvas( caps );
+ final GLCanvas glCanvas = new GLCanvas( caps );
frame.add( glCanvas );
- frame.setSize( 128, 128 );
-
- final Frame _frame = frame;
- final GLCanvas _glCanvas = glCanvas;
try {
javax.swing.SwingUtilities.invokeAndWait( new Runnable() {
public void run() {
- _frame.setVisible( true );
+ frame.setSize( 128, 128 );
+ frame.setVisible( true );
}
} );
}
@@ -53,9 +50,9 @@ public class TestAWTCloseX11DisplayBug565 {
try {
javax.swing.SwingUtilities.invokeAndWait( new Runnable() {
public void run() {
- _frame.setVisible( false );
- _frame.remove( _glCanvas );
- _frame.dispose();
+ frame.setVisible( false );
+ frame.remove( glCanvas );
+ frame.dispose();
}
} );
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
index 976885de4..afcf51e08 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
@@ -54,7 +54,6 @@ public class TestShutdownCompleteAWT extends UITestCase {
final GLCanvas glCanvas = new GLCanvas(new GLCapabilities(GLProfile.getGL2ES2()));
Assert.assertNotNull(glCanvas);
frame.add(glCanvas);
- frame.setSize(256, 256);
glCanvas.addGLEventListener(new GearsES2(1));
@@ -62,6 +61,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setSize(256, 256);
frame.setVisible(true);
}});
@@ -78,7 +78,10 @@ public class TestShutdownCompleteAWT extends UITestCase {
animator.stop();
Assert.assertEquals(false, animator.isAnimating());
- frame.setVisible(false);
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ }});
Assert.assertEquals(false, frame.isVisible());
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
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 e1048c2f8..d444f02f7 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
@@ -60,15 +60,15 @@ public class TestAWT01GLn extends UITestCase {
glCanvas.addGLEventListener(new GearsES2());
frame.add(glCanvas);
- // Revalidate size/layout.
- // Always validate if component added/removed.
- // Ensure 1st paint of GLCanvas will have a valid size, hence drawable gets created.
- frame.setSize(512, 512);
- frame.validate();
-
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ // Revalidate size/layout.
+ // Always validate if component added/removed.
+ // Ensure 1st paint of GLCanvas will have a valid size, hence drawable gets created.
+ frame.setSize(512, 512);
+ frame.validate();
+
frame.setVisible(true);
}});
} catch (Throwable t) {
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 f83c8c03d..6c0bc7701 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
@@ -29,16 +29,12 @@
package com.jogamp.opengl.test.junit.jogl.awt;
import com.jogamp.opengl.test.junit.util.UITestCase;
-import javax.media.opengl.GLProfile;
import java.awt.*;
import java.awt.event.*;
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 TestAWT02WindowClosing extends UITestCase {
@@ -47,15 +43,14 @@ public class TestAWT02WindowClosing extends UITestCase {
@Test
public void test01WindowClosing() throws InterruptedException {
- Frame frame = new Frame();
- frame.setSize(500, 500);
+ final Frame frame = new Frame();
ClosingWindowAdapter closingWindowAdapter = new ClosingWindowAdapter(frame);
frame.addWindowListener(closingWindowAdapter);
- final Frame _frame = frame;
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- _frame.setVisible(true);
+ frame.setSize(500, 500);
+ frame.setVisible(true);
}});
} catch (Throwable t) {
t.printStackTrace();
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 aa7b4e06b..49ad1c9ba 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
@@ -139,7 +139,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
}
private void setVisible(final Frame frame, final boolean v) {
- try {
+ try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
frame.setVisible(v);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWTCardLayoutAnimatorStartStopBug532.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWTCardLayoutAnimatorStartStopBug532.java
index 3f6935588..1237fc9d4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWTCardLayoutAnimatorStartStopBug532.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWTCardLayoutAnimatorStartStopBug532.java
@@ -167,11 +167,10 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
frame.add(comboBoxPanel, BorderLayout.PAGE_START);
frame.add(cards, BorderLayout.CENTER);
-
- frame.pack();
-
+
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.pack();
frame.setVisible(true);
}});
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
index 42949afef..089520658 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
@@ -57,7 +57,6 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
*
* @author Wade Walker (from code sample provided by Owen Dimond)
*/
-@SuppressWarnings("deprecation")
public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GLEventListener {
JFrame jframe;
GLOffscreenAutoDrawable offScreenBuffer;
@@ -92,8 +91,15 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
BufferedImage outputImage = com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(200, 200, false);
Assert.assertNotNull(outputImage);
ImageIcon imageIcon = new ImageIcon(outputImage);
- JLabel imageLabel = new JLabel(imageIcon);
- jframe.getContentPane().add(imageLabel);
+ final JLabel imageLabel = new JLabel(imageIcon);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ jframe.getContentPane().add(imageLabel);
+ }});
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
}
/* @Override */
@@ -113,7 +119,6 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
public void testOffscreenSupersampling() throws InterruptedException, InvocationTargetException {
jframe = new JFrame("Offscreen Supersampling");
Assert.assertNotNull(jframe);
- jframe.setSize( 300, 300);
jframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
@@ -147,6 +152,7 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
offScreenBuffer.display();
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ jframe.setSize( 300, 300);
jframe.setVisible(true);
}});
offScreenBuffer.destroy();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
index c51972c39..0bcde2b35 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
@@ -36,6 +36,7 @@ import javax.media.opengl.awt.GLCanvas;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionNumber;
+import com.jogamp.common.util.awt.AWTEDTExecutor;
import com.jogamp.opengl.util.Animator;
import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.util.FPSAnimator;
@@ -51,6 +52,7 @@ import java.awt.Frame;
import java.awt.Insets;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import java.lang.reflect.InvocationTargetException;
import org.junit.Assert;
import org.junit.Assume;
@@ -70,6 +72,9 @@ import org.junit.Test;
* Similar deadlock has been experienced w/ other mutable operation on an AWT Container owning a GLCanvas child,
* e.g. setResizable*().
* </p>
+ * <p>
+ * Users shall make sure all mutable AWT calls are performed on the EDT, even before 1st setVisible(true) !
+ * </p>
*/
public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
static long durationPerTest = 1000; // ms
@@ -80,40 +85,45 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
GLEventListener gle2 = null;
@Test
- public void test00NoAnimator() throws InterruptedException {
+ public void test00NoAnimator() throws InterruptedException, InvocationTargetException {
testImpl(null, 0, false);
}
@Test
- public void test01Animator() throws InterruptedException {
+ public void test01Animator() throws InterruptedException, InvocationTargetException {
testImpl(new Animator(), 0, false);
}
@Test
- public void test02FPSAnimator() throws InterruptedException {
+ public void test02FPSAnimator() throws InterruptedException, InvocationTargetException {
testImpl(new FPSAnimator(30), 0, false);
}
@Test
- public void test02FPSAnimator_RestartOnAWTEDT() throws InterruptedException {
+ public void test02FPSAnimator_RestartOnAWTEDT() throws InterruptedException, InvocationTargetException {
testImpl(new FPSAnimator(30), 200, false);
}
/** May crash due to invalid thread usage, i.e. non AWT-EDT
+ * @throws InvocationTargetException
+ * @throws InterruptedException
@Test
public void test02FPSAnimator_RestartOnCurrentThread() throws InterruptedException {
testImpl(new FPSAnimator(30), 200, true);
} */
- private static void setFrameTitle(Frame frame, String msg) {
+ private static void setFrameTitle(final Frame frame, final String msg) {
System.err.println("About to setTitle: <"+msg+"> CT "+Thread.currentThread().getName()+", "+
frame+", displayable "+frame.isDisplayable()+
", valid "+frame.isValid()+", visible "+frame.isVisible());
// Thread.dumpStack();
- frame.setTitle(msg);
+ AWTEDTExecutor.singleton.invoke(true, new Runnable() {
+ public void run() {
+ frame.setTitle(msg);
+ } } );
}
- void testImpl(final AnimatorBase animator, int restartPeriod, boolean restartOnCurrentThread) throws InterruptedException {
+ void testImpl(final AnimatorBase animator, int restartPeriod, boolean restartOnCurrentThread) throws InterruptedException, InvocationTargetException {
final Frame frame1 = new Frame("Frame 1");
final Applet applet1 = new Applet() {
private static final long serialVersionUID = 1L;
@@ -127,20 +137,23 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
System.err.println("Java Version "+Platform.getJavaVersionNumber());
Assert.assertNotNull(frame1);
- frame1.setLayout(null);
- frame1.pack();
- {
- Insets insets = frame1.getInsets();
- int w = width + insets.left + insets.right;
- int h = height + insets.top + insets.bottom;
- frame1.setSize(w, h);
-
- int usableH = h - insets.top - insets.bottom;
- applet1.setBounds((w - width)/2, insets.top + (usableH - height)/2, width, height);
- }
- frame1.setLocation(0, 0);
- frame1.setTitle("Generic Title");
- frame1.add(applet1);
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame1.setLayout(null);
+ frame1.pack();
+ {
+ Insets insets = frame1.getInsets();
+ int w = width + insets.left + insets.right;
+ int h = height + insets.top + insets.bottom;
+ frame1.setSize(w, h);
+
+ int usableH = h - insets.top - insets.bottom;
+ applet1.setBounds((w - width)/2, insets.top + (usableH - height)/2, width, height);
+ }
+ frame1.setLocation(0, 0);
+ frame1.setTitle("Generic Title");
+ frame1.add(applet1);
+ }});
frame1.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
index d8f25868b..289c62423 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
@@ -55,6 +55,7 @@ import org.junit.Test;
import com.jogamp.common.os.Platform;
import com.jogamp.common.util.VersionNumber;
+import com.jogamp.common.util.awt.AWTEDTExecutor;
import com.jogamp.opengl.util.AnimatorBase;
import com.jogamp.opengl.test.junit.util.MiscUtils;
import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -77,6 +78,9 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
* Similar deadlock has been experienced w/ other mutable operation on an AWT Container owning a GLCanvas child,
* e.g. setResizable*().
* </p>
+ * <p>
+ * Users shall make sure all mutable AWT calls are performed on the EDT, even before 1st setVisible(true) !
+ * </p>
*/
public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
static int framesPerTest = 240; // frames
@@ -193,53 +197,77 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
width = 300;
height = 300;
- MiniPApplet applet = this;
- Rectangle fullScreenRect = null;
+ final MiniPApplet applet = this;
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
frame = new Frame(displayDevice.getDefaultConfiguration());
- frame.setTitle("MiniPApplet");
+ final Rectangle fullScreenRect;
if (fullScreen) {
- frame.setUndecorated(true);
- frame.setBackground(Color.GRAY);
DisplayMode mode = displayDevice.getDisplayMode();
fullScreenRect = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());
- frame.setBounds(fullScreenRect);
- frame.setVisible(true);
- }
- frame.setLayout(null);
- frame.add(applet);
- if (fullScreen) {
- frame.invalidate();
} else {
- frame.pack();
+ fullScreenRect = null;
}
- frame.setResizable(resizeableFrame);
-
+ // All AWT Mods on AWT-EDT, especially due to the follow-up complicated code!
+ AWTEDTExecutor.singleton.invoke(true, new Runnable() {
+ public void run() {
+ frame.setTitle("MiniPApplet");
+ } } );
if (fullScreen) {
- // After the pack(), the screen bounds are gonna be 0s
- frame.setBounds(fullScreenRect);
- applet.setBounds((fullScreenRect.width - applet.width) / 2,
- (fullScreenRect.height - applet.height) / 2,
- applet.width, applet.height);
- } else {
- Insets insets = frame.getInsets();
-
- int windowW = applet.width + insets.left + insets.right;
- int windowH = applet.height + insets.top + insets.bottom;
- int locationX = 100;
- int locationY = 100;
-
- frame.setSize(windowW, windowH);
- frame.setLocation(locationX, locationY);
-
- int usableWindowH = windowH - insets.top - insets.bottom;
- applet.setBounds((windowW - width)/2, insets.top + (usableWindowH - height)/2, width, height);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setUndecorated(true);
+ frame.setBackground(Color.GRAY);
+ frame.setBounds(fullScreenRect);
+ frame.setVisible(true);
+ }});
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Assume.assumeNoException(t);
+ }
+ }
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setLayout(null);
+ frame.add(applet);
+ if (fullScreen) {
+ frame.invalidate();
+ } else {
+ frame.pack();
+ }
+ frame.setResizable(resizeableFrame);
+ if (fullScreen) {
+ // After the pack(), the screen bounds are gonna be 0s
+ frame.setBounds(fullScreenRect);
+ applet.setBounds((fullScreenRect.width - applet.width) / 2,
+ (fullScreenRect.height - applet.height) / 2,
+ applet.width, applet.height);
+ } else {
+ Insets insets = frame.getInsets();
+
+ int windowW = applet.width + insets.left + insets.right;
+ int windowH = applet.height + insets.top + insets.bottom;
+ int locationX = 100;
+ int locationY = 100;
+
+ frame.setSize(windowW, windowH);
+ frame.setLocation(locationX, locationY);
+
+ int usableWindowH = windowH - insets.top - insets.bottom;
+ applet.setBounds((windowW - width)/2, insets.top + (usableWindowH - height)/2, width, height);
+ }
+ }});
+ } catch (Throwable t) {
+ t.printStackTrace();
+ Assume.assumeNoException(t);
}
+
frame.add(this);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
@@ -253,7 +281,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- frame.setVisible(true); // from here on all AWT mods must be done on AWT-EDT !
+ frame.setVisible(true);
} } );
// Canvas setup ----------------------------------------------------------
@@ -359,7 +387,10 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
void draw(GL2 gl) {
if( !osxCALayerAWTModBug || !justInitialized ) {
- frame.setTitle("frame " + frameCount);
+ AWTEDTExecutor.singleton.invoke(true, new Runnable() {
+ public void run() {
+ frame.setTitle("frame " + frameCount);
+ } } );
}
if (printThreadInfo) System.out.println("Current thread at draw(): " + Thread.currentThread());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
index 8868d255d..991f4acf8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
@@ -106,13 +106,13 @@ public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
panel.add(textArea, BorderLayout.NORTH);
frame.add(panel);
- frame.setLocationRelativeTo(null);
- frame.setTitle("GLCanvas in JScrollPane example");
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
try {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setLocationRelativeTo(null);
+ frame.setTitle("GLCanvas in JScrollPane example");
frame.setSize(f_sz);
frame.setVisible(true);
}});
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 ab369a959..ffe3bb3a6 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
@@ -37,7 +37,6 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
import java.awt.Frame;
import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
import org.junit.Assert;
import org.junit.Assume;
@@ -84,9 +83,16 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
frame = new Frame("TextRenderer Test");
Assert.assertNotNull(frame);
frame.add(glCanvas);
- frame.setSize(512, 512);
- frame.setVisible(true);
-
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setSize(512, 512);
+ frame.setVisible(true);
+ }});
+ } catch( Throwable throwable ) {
+ throwable.printStackTrace();
+ Assume.assumeNoException( throwable );
+ }
}
@After
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
index c5bdfb5f3..208367102 100755
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
@@ -116,11 +116,11 @@ public class TestMultisampleES1AWT extends UITestCase {
final Frame frame = new Frame("Multi Samples "+reqSamples);
frame.setLayout(new BorderLayout());
canvas.setSize(512, 512);
- frame.add(canvas, BorderLayout.CENTER);
- frame.pack();
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.add(canvas, BorderLayout.CENTER);
+ frame.pack();
frame.setVisible(true);
canvas.requestFocus();
canvas.display();
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 7cce5d1e4..6d8270aaf 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
@@ -119,18 +119,21 @@ public class TestTranslucencyAWT extends UITestCase {
GLAnimatorControl animator1 = new Animator(glCanvas);
animator1.start();
- Container cont1 = new Container();
+ final Container cont1 = new Container();
cont1.setLayout(new BorderLayout());
cont1.add(glCanvas, BorderLayout.CENTER);
- cont1.setVisible(true);
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ cont1.setVisible(true);
+ }});
frame1.setLayout(new BorderLayout());
frame1.add(cont1, BorderLayout.EAST);
frame1.add(new Label("center"), BorderLayout.CENTER);
- frame1.setLocation(0, 0);
- frame1.setSize((int)size.getWidth(), (int)size.getHeight());
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setLocation(0, 0);
+ frame1.setSize((int)size.getWidth(), (int)size.getHeight());
frame1.pack();
frame1.setVisible(true);
}});
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
index aca2b675c..d59b81ff1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
@@ -211,7 +211,10 @@ public class TestGearsES2AWT extends UITestCase {
Assert.assertFalse(animator.isAnimating());
Assert.assertFalse(animator.isStarted());
Assert.assertEquals(null, glCanvas.getExclusiveContextThread());
- frame.setVisible(false);
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ }});
Assert.assertEquals(false, frame.isVisible());
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
index bd9b7cae7..aaf995e6c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
@@ -87,10 +87,10 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
throws AWTException, InterruptedException, InvocationTargetException
{
final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
- JFrame frame = new JFrame("Swing GLJPanel");
+ final JFrame frame = new JFrame("Swing GLJPanel");
Assert.assertNotNull(frame);
- GLJPanel glJPanel = new GLJPanel(caps);
+ final GLJPanel glJPanel = new GLJPanel(caps);
Assert.assertNotNull(glJPanel);
RedSquareES2 demo = new RedSquareES2();
demo.setAspect((float)width/(float)height);
@@ -129,13 +129,11 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
FPSAnimator animator = new FPSAnimator(glJPanel, 60);
- final JFrame _frame = frame;
- final GLJPanel _glJPanel = glJPanel;
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- _frame.getContentPane().add(_glJPanel, BorderLayout.CENTER);
- _frame.setSize(width, height);
- _frame.setVisible(true);
+ frame.getContentPane().add(glJPanel, BorderLayout.CENTER);
+ frame.setSize(width, height);
+ frame.setVisible(true);
} } ) ;
animator.setUpdateFPSFrames(1, null);
@@ -154,11 +152,11 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
Assert.assertEquals(false, animator.isAnimating());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- _frame.setVisible(false);
- _frame.getContentPane().remove(_glJPanel);
- _frame.remove(_glJPanel);
- _glJPanel.destroy();
- _frame.dispose();
+ frame.setVisible(false);
+ frame.getContentPane().remove(glJPanel);
+ frame.remove(glJPanel);
+ glJPanel.destroy();
+ frame.dispose();
} } );
Assert.assertFalse( failed );
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 498a3285a..528762a9c 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
@@ -114,7 +114,10 @@ public class TestGearsAWT extends UITestCase {
animator.stop();
Assert.assertEquals(false, animator.isAnimating());
- frame.setVisible(false);
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ }});
Assert.assertEquals(false, frame.isVisible());
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
index 4807e5d25..22df3313b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
@@ -105,7 +105,6 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
Assert.assertNotNull(glCanvas);
glCanvas.setAutoSwapBufferMode(!altSwap);
frame.add(glCanvas);
- frame.setSize(512, 512);
glCanvas.addGLEventListener(new Gears(0));
glCanvas.addGLEventListener(new Swapper());
@@ -118,6 +117,7 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setSize(512, 512);
frame.setVisible(true);
}});
animator.setUpdateFPSFrames(60, System.err);
@@ -133,7 +133,10 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
animator.stop();
Assert.assertEquals(false, animator.isAnimating());
- frame.setVisible(false);
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setVisible(false);
+ }});
Assert.assertEquals(false, frame.isVisible());
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
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 cb54c26bd..d27f3dcf8 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
@@ -70,10 +70,10 @@ public class TestGearsGLJPanelAWT extends UITestCase {
protected void runTestGL(GLCapabilities caps)
throws AWTException, InterruptedException, InvocationTargetException
{
- JFrame frame = new JFrame("Swing GLJPanel");
+ final JFrame frame = new JFrame("Swing GLJPanel");
Assert.assertNotNull(frame);
- GLJPanel glJPanel = new GLJPanel(caps);
+ final GLJPanel glJPanel = new GLJPanel(caps);
Assert.assertNotNull(glJPanel);
Dimension glc_sz = new Dimension(width, height);
glJPanel.setMinimumSize(glc_sz);
@@ -83,14 +83,12 @@ public class TestGearsGLJPanelAWT extends UITestCase {
FPSAnimator animator = new FPSAnimator(glJPanel, 60);
- final JFrame _frame = frame;
- final GLJPanel _glJPanel = glJPanel;
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- _frame.getContentPane().add(_glJPanel, BorderLayout.CENTER);
- _frame.getContentPane().validate();
- _frame.pack();
- _frame.setVisible(true);
+ frame.getContentPane().add(glJPanel, BorderLayout.CENTER);
+ frame.getContentPane().validate();
+ frame.pack();
+ frame.setVisible(true);
} } ) ;
animator.setUpdateFPSFrames(1, null);
@@ -109,11 +107,11 @@ public class TestGearsGLJPanelAWT extends UITestCase {
Assert.assertEquals(false, animator.isAnimating());
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- _frame.setVisible(false);
- _frame.getContentPane().remove(_glJPanel);
- _frame.remove(_glJPanel);
- _glJPanel.destroy();
- _frame.dispose();
+ frame.setVisible(false);
+ frame.getContentPane().remove(glJPanel);
+ frame.remove(glJPanel);
+ glJPanel.destroy();
+ frame.dispose();
} } );
}
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 d133ebde5..4d878432f 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
@@ -81,7 +81,6 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
final GLCanvas glCanvas = new GLCanvas(caps);
Assert.assertNotNull(glCanvas);
frame.add(glCanvas);
- frame.setSize(512, 512);
glCanvas.addGLEventListener(new GLEventListener() {
/* @Override */
@@ -131,7 +130,15 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
});
Animator animator = new Animator(glCanvas);
- frame.setVisible(true);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setSize(512, 512);
+ frame.setVisible(true);
+ } } );
+ } catch(Exception ex) {
+ throw new RuntimeException(ex);
+ }
animator.setUpdateFPSFrames(1, null);
animator.start();
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 0e9b6cd88..a6b3eb85d 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
@@ -142,15 +142,15 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
}
});
frame.setContentPane(panel);
- frame.setSize(512, 512);
- frame.setLocation(0, 0);
- frame.pack();
// AWT/Swing: From here on (post setVisible(true)
// you need to use AWT/Swing's invokeAndWait()
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setSize(512, 512);
+ frame.setLocation(0, 0);
+ frame.pack();
frame.setVisible(true);
colorPanel.setBackground(Color.white);
colorPanel.repaint();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
index 91902a896..5803a1675 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
@@ -83,10 +83,17 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
return;
}
System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
- Frame f0 = new Frame("Test - AWT 1st");
+ final Frame f0 = new Frame("Test - AWT 1st");
f0.add(new java.awt.Label("AWT was here 1st"));
- f0.pack();
- f0.setVisible(true);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ f0.pack();
+ f0.setVisible(true);
+ }});
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
if(!GLProfile.isAvailable(GLProfile.GL2)) {
setTestSupported(false);
}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
index 2d7b3b080..8baba68ec 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
@@ -111,14 +111,22 @@ public class TestTexture01AWT extends UITestCase {
final Frame frame = new Frame("Texture Test");
Assert.assertNotNull(frame);
frame.add(glCanvas);
- frame.setSize(512, 512);
// create texture
TextureData textureData = AWTTextureIO.newTextureData(caps.getGLProfile(), textureImage, false);
glCanvas.addGLEventListener(new TextureDraw01GL2Listener(textureData));
Animator animator = new Animator(glCanvas);
- frame.setVisible(true);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setSize(512, 512);
+ frame.setVisible(true);
+ }});
+ } catch( Throwable throwable ) {
+ throwable.printStackTrace();
+ Assume.assumeNoException( throwable );
+ }
animator.start();
Thread.sleep(500); // 500 ms
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
index 36dad45e6..7bad83781 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
@@ -42,7 +42,6 @@ public class TestTextureSequence01AWT extends UITestCase {
final Frame frame = new Frame("TestTextureSequence01AWT");
Assert.assertNotNull(frame);
frame.add(glc);
- frame.setSize(width, height);
final TextureSequenceDemo01 texSource = new TextureSequenceDemo01(useBuildInTexLookup);
glc.addGLEventListener(new GLEventListener() {
@@ -63,7 +62,16 @@ public class TestTextureSequence01AWT extends UITestCase {
QuitAdapter quitAdapter = new QuitAdapter();
new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter).addTo(glc);
new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter).addTo(glc);
- frame.setVisible(true);
+ try {
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame.setSize(width, height);
+ frame.setVisible(true);
+ }});
+ } catch( Throwable throwable ) {
+ throwable.printStackTrace();
+ Assume.assumeNoException( throwable );
+ }
animator.start();
while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
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 0e87144da..978bc1c0a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestFocus02SwingAWTRobot.java
@@ -72,15 +72,20 @@ public class TestFocus02SwingAWTRobot extends UITestCase {
static GLCapabilities glCaps;
@BeforeClass
- public static void initClass() throws AWTException {
+ public static void initClass() throws AWTException, InterruptedException, InvocationTargetException {
width = 640;
height = 480;
- JFrame f = new JFrame();
- f.setSize(100,100);
- f.setVisible(true);
- f.dispose();
- f=null;
+ final JFrame f = new JFrame();
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ f.setSize(100,100);
+ f.setVisible(true);
+ } } );
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ f.dispose();
+ } } );
glCaps = new GLCapabilities(null);
}
@@ -126,7 +131,7 @@ public class TestFocus02SwingAWTRobot extends UITestCase {
AWTMouseAdapter buttonNorthInnerMA = new AWTMouseAdapter("ButtonNorthInner");
buttonNorthInner.addMouseListener(buttonNorthInnerMA);
eventCountAdapters.add(buttonNorthInnerMA);
- Container container1 = new Container();
+ final Container container1 = new Container();
container1.setLayout(new BorderLayout());
container1.add(buttonNorthInner, BorderLayout.NORTH);
container1.add(new Button("south"), BorderLayout.SOUTH);
@@ -143,7 +148,7 @@ public class TestFocus02SwingAWTRobot extends UITestCase {
AWTMouseAdapter buttonNorthOuterMA = new AWTMouseAdapter("ButtonNorthOuter");
buttonNorthOuter.addMouseListener(buttonNorthOuterMA);
eventCountAdapters.add(buttonNorthOuterMA);
- JPanel jPanel1 = new JPanel();
+ final JPanel jPanel1 = new JPanel();
jPanel1.setLayout(new BorderLayout());
jPanel1.add(buttonNorthOuter, BorderLayout.NORTH);
jPanel1.add(new Button("south"), BorderLayout.SOUTH);
@@ -249,14 +254,11 @@ public class TestFocus02SwingAWTRobot extends UITestCase {
animator1.stop();
Assert.assertEquals(false, animator1.isAnimating());
- final JFrame _jFrame1 = jFrame1;
- final JPanel _jPanel1 = jPanel1;
- final Container _container1 = container1;
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
- _jFrame1.setVisible(false);
- _jPanel1.remove(_container1);
- _jFrame1.dispose();
+ jFrame1.setVisible(false);
+ jPanel1.remove(container1);
+ jFrame1.dispose();
} });
glWindow1.destroy();
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
index 5b7986f4d..acaa279fe 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
@@ -117,14 +117,14 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
GLProfile glp = GLProfile.getGL2ES2();
GLCapabilities caps = new GLCapabilities(glp);
- GLCanvas glCanvas = new GLCanvas(caps);
+ final GLCanvas glCanvas = new GLCanvas(caps);
glCanvas.addGLEventListener(new GearsES2());
- frame.getContentPane().add(glCanvas);
- frame.pack();
- frame.setSize(512, 512);
- frame.validate();
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.getContentPane().add(glCanvas);
+ frame.pack();
+ frame.setSize(512, 512);
+ frame.validate();
frame.setVisible(true);
} });
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
@@ -139,9 +139,10 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
Thread.sleep(300);
- Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener)); // nop
- Thread.sleep(100);
+ Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, closingListener)); // hide
+ Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible
Assert.assertEquals(true, frame.isDisplayable());
+ Assert.assertEquals(false, frame.isVisible());
Assert.assertEquals(true, glCanvas.isValid());
Assert.assertEquals(true, glCanvas.isDisplayable());
@@ -151,6 +152,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
} });
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glCanvas, true));
+ Assert.assertEquals(true, frame.isDisplayable());
+ Assert.assertEquals(true, frame.isVisible());
//
// close with op (JFrame): DISPOSE_ON_CLOSE -- GLCanvas --> dispose
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
index b0a222a5a..45b41219a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
@@ -91,7 +91,8 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
Thread.sleep(300);
- Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, awtClosingListener));
+ Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, false, awtClosingListener)); // hide
+ Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible
Assert.assertEquals(true, frame.isDisplayable());
Assert.assertEquals(false, frame.isVisible());
Assert.assertEquals(true, newtCanvas.isValid());
@@ -109,6 +110,7 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
frame.setVisible(true);
} });
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true));
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, true));
Assert.assertEquals(true, frame.isDisplayable());
Assert.assertEquals(true, frame.isVisible());
@@ -125,6 +127,7 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
Thread.sleep(300);
Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, awtClosingListener));
+ Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow, false));
Assert.assertEquals(false, frame.isDisplayable());
Assert.assertEquals(false, frame.isVisible());
Assert.assertEquals(false, newtCanvas.isValid());
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
index b3ba71795..277924477 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
@@ -114,9 +114,9 @@ public class TestNewtKeyCodesAWT extends UITestCase {
// Add the canvas to a frame, and make it all visible.
final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
- frame1.setSize(width, height);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setSize(width, height);
frame1.setVisible(true);
} } );
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 de29db417..21c737d8f 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
@@ -98,11 +98,11 @@ public class TestParenting01aAWT extends UITestCase {
container1.add(newtCanvasAWT, BorderLayout.CENTER);
frame1.add(container1, BorderLayout.CENTER);
- frame1.setSize(width, height);
// visible test
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setSize(width, height);
frame1.setVisible(true);
}
});
@@ -168,11 +168,11 @@ public class TestParenting01aAWT extends UITestCase {
final Frame frame = new Frame("AWT Parent Frame");
Assert.assertNotNull(frame);
- frame.setSize(width, height);
// visible test
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setSize(width, height);
frame.setVisible(true);
}
});
@@ -212,11 +212,11 @@ public class TestParenting01aAWT extends UITestCase {
final Frame frame = new Frame("AWT Parent Frame");
Assert.assertNotNull(frame);
- frame.setSize(width, height);
// visible test
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setSize(width, height);
frame.setVisible(true);
}
});
@@ -256,10 +256,10 @@ public class TestParenting01aAWT extends UITestCase {
final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
final Frame frame = new Frame("AWT Parent Frame");
- frame.setSize(width, height);
- frame.setLocation(640, 480);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setSize(width, height);
+ frame.setLocation(640, 480);
frame.setVisible(true);
}
});
@@ -320,11 +320,11 @@ public class TestParenting01aAWT extends UITestCase {
frame.add(new Button("South"), BorderLayout.SOUTH);
frame.add(new Button("East"), BorderLayout.EAST);
frame.add(new Button("West"), BorderLayout.WEST);
- frame.setSize(width, height);
- frame.setLocation(640, 480);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame.setSize(width, height);
+ frame.setLocation(640, 480);
frame.setVisible(true);
}
});
@@ -386,10 +386,10 @@ public class TestParenting01aAWT extends UITestCase {
frame1.add(new Button("South"), BorderLayout.SOUTH);
frame1.add(new Button("East"), BorderLayout.EAST);
frame1.add(new Button("West"), BorderLayout.WEST);
- frame1.setSize(width, height);
- frame1.setLocation(0, 0);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setSize(width, height);
+ frame1.setLocation(0, 0);
frame1.setVisible(true);
}
});
@@ -400,10 +400,10 @@ public class TestParenting01aAWT extends UITestCase {
frame2.add(new Button("South"), BorderLayout.SOUTH);
frame2.add(new Button("East"), BorderLayout.EAST);
frame2.add(new Button("West"), BorderLayout.WEST);
- frame2.setSize(width, height);
- frame2.setLocation(640, 480);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame2.setSize(width, height);
+ frame2.setLocation(640, 480);
frame2.setVisible(true);
}
});
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 d98a540ec..906aeee45 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
@@ -89,10 +89,10 @@ public class TestParenting01bAWT extends UITestCase {
frame1.add(new Button("South"), BorderLayout.SOUTH);
frame1.add(new Button("East"), BorderLayout.EAST);
frame1.add(new Button("West"), BorderLayout.WEST);
- frame1.setSize(width, height);
- frame1.setLocation(0, 0);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setSize(width, height);
+ frame1.setLocation(0, 0);
frame1.setVisible(true);
}
});
@@ -103,10 +103,10 @@ public class TestParenting01bAWT extends UITestCase {
frame2.add(new Button("South"), BorderLayout.SOUTH);
frame2.add(new Button("East"), BorderLayout.EAST);
frame2.add(new Button("West"), BorderLayout.WEST);
- frame2.setSize(width, height);
- frame2.setLocation(640, 480);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame2.setSize(width, height);
+ frame2.setLocation(640, 480);
frame2.setVisible(true);
}
});
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 dfd0787e7..aade7f93a 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
@@ -98,11 +98,11 @@ public class TestParenting01cAWT extends UITestCase {
container1.add(newtCanvasAWT, BorderLayout.CENTER);
frame1.add(container1, BorderLayout.CENTER);
- frame1.setSize(width, height);
// visible test
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setSize(width, height);
frame1.setVisible(true);
}
});
@@ -160,10 +160,10 @@ public class TestParenting01cAWT extends UITestCase {
frame1.add(new Button("South"), BorderLayout.SOUTH);
frame1.add(new Button("East"), BorderLayout.EAST);
frame1.add(new Button("West"), BorderLayout.WEST);
- frame1.setSize(width, height);
- frame1.setLocation(0, 0);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setSize(width, height);
+ frame1.setLocation(0, 0);
frame1.setVisible(true);
}
});
@@ -174,10 +174,10 @@ public class TestParenting01cAWT extends UITestCase {
frame2.add(new Button("South"), BorderLayout.SOUTH);
frame2.add(new Button("East"), BorderLayout.EAST);
frame2.add(new Button("West"), BorderLayout.WEST);
- frame2.setSize(width, height);
- frame2.setLocation(640, 480);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame2.setSize(width, height);
+ frame2.setLocation(640, 480);
frame2.setVisible(true);
}
});
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 4b02be873..c84823a04 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
@@ -165,10 +165,10 @@ public class TestParenting01cSwingAWT extends UITestCase {
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.setContentPane(jPanel1);
- jFrame1.setSize(width, height);
System.err.println("Demos: 1 - Visible");
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ jFrame1.setSize(width, height);
jFrame1.setVisible(true);
}
});
@@ -292,10 +292,10 @@ public class TestParenting01cSwingAWT extends UITestCase {
// jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame1.setContentPane(jPanel1);
- jFrame1.setLocation(0, 0);
- jFrame1.setSize(width, height);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ jFrame1.setLocation(0, 0);
+ jFrame1.setSize(width, height);
jFrame1.setVisible(true);
}
});
@@ -311,10 +311,10 @@ public class TestParenting01cSwingAWT extends UITestCase {
// jFrame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame2.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
jFrame2.setContentPane(jPanel2);
- jFrame2.setLocation(640, 480);
- jFrame2.setSize(width, height);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ jFrame2.setLocation(640, 480);
+ jFrame2.setSize(width, height);
jFrame2.setVisible(true);
}
});
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 da689cea6..dc1c0ba57 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
@@ -118,11 +118,10 @@ public class TestParenting02AWT extends UITestCase {
}
}
- // frame.setSize(width, height);
- frame.setBounds(100, 100, width, height);
-
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ // frame.setSize(width, height);
+ frame.setBounds(100, 100, width, height);
frame.setVisible(true);
}});
// X11: true, Windows: false - Assert.assertEquals(true, glWindow.isVisible());
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 b33a40fae..4f880347a 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
@@ -133,11 +133,11 @@ public class TestParenting03AWT extends UITestCase {
frame1.add(new Button("CENTER"), BorderLayout.CENTER);
frame1.add(new Button("SOUTH"), BorderLayout.SOUTH);
frame1.add(cont1, BorderLayout.EAST);
- frame1.setLocation(0, 0);
- frame1.setSize(fSize);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
System.err.println("******* Frame setVisible");
+ frame1.setLocation(0, 0);
+ frame1.setSize(fSize);
frame1.validate();
frame1.setVisible(true);
}});
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
index 09b6d048c..b0e58b5ec 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
@@ -100,10 +100,10 @@ public class TestParenting04AWT extends UITestCase {
frame1.add(new Button("South"), BorderLayout.SOUTH);
frame1.add(new Button("East"), BorderLayout.EAST);
frame1.add(new Button("West"), BorderLayout.WEST);
- frame1.setSize(width, height);
- frame1.setLocation(0, 0);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setSize(width, height);
+ frame1.setLocation(0, 0);
frame1.setVisible(true);
frame1.validate();
}
@@ -123,10 +123,10 @@ public class TestParenting04AWT extends UITestCase {
frame2.add(new Button("South"), BorderLayout.SOUTH);
frame2.add(new Button("East"), BorderLayout.EAST);
frame2.add(new Button("West"), BorderLayout.WEST);
- frame2.setSize(width, height);
- frame2.setLocation(width+50, 0);
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame2.setSize(width, height);
+ frame2.setLocation(width+50, 0);
frame2.setVisible(true);
frame2.validate();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java
index 122138f6d..a1f07bda6 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParentingFocusTraversal01AWT.java
@@ -183,10 +183,10 @@ public class TestParentingFocusTraversal01AWT extends UITestCase {
frame1.add(newtCanvasAWT1, BorderLayout.CENTER);
frame1.add(cEast, BorderLayout.EAST);
- frame1.setLocation(0, 0);
- frame1.setSize(fSize);
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setLocation(0, 0);
+ frame1.setSize(fSize);
frame1.validate();
frame1.setVisible(true);
}});
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 280cc7495..2d668c224 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
@@ -137,10 +137,10 @@ public class TestTranslucentParentingAWT extends UITestCase {
frame1.setLayout(new BorderLayout());
frame1.add(cont1, BorderLayout.EAST);
frame1.add(new Label("center"), BorderLayout.CENTER);
- frame1.setLocation(0, 0);
- frame1.setSize((int)size.getWidth(), (int)size.getHeight());
javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ frame1.setLocation(0, 0);
+ frame1.setSize((int)size.getWidth(), (int)size.getHeight());
frame1.pack();
frame1.setVisible(true);
}});
@@ -157,7 +157,10 @@ public class TestTranslucentParentingAWT extends UITestCase {
Assert.assertEquals(false, animator1.isPaused());
Assert.assertEquals(null, animator1.getThread());
- frame1.dispose();
+ javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+ public void run() {
+ frame1.dispose();
+ } } );
glWindow1.destroy();
}