29package com.jogamp.opengl.test.junit.jogl.acore;
31import com.jogamp.opengl.GLProfile;
32import com.jogamp.opengl.GLCapabilities;
33import com.jogamp.opengl.awt.GLCanvas;
34import com.jogamp.opengl.util.Animator;
35import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
36import com.jogamp.opengl.test.junit.util.GLTestUtil;
37import com.jogamp.opengl.test.junit.util.UITestCase;
38import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
41import java.awt.event.WindowAdapter;
42import java.awt.event.WindowEvent;
44import org.junit.Assert;
45import org.junit.Assume;
46import org.junit.BeforeClass;
48import org.junit.FixMethodOrder;
49import org.junit.runners.MethodSorters;
52@FixMethodOrder(MethodSorters.NAME_ASCENDING)
60 final Frame frame =
new Frame(
"TestBug1398AWT");
61 Assert.assertNotNull(frame);
64 Assert.assertNotNull(glCanvas);
83 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
89 frame.setSize(512, 512);
90 if( triggerDeadlock ) {
91 frame.setExtendedState(java.awt.Frame.MAXIMIZED_BOTH);
95 frame.setVisible(
true);
97 }
catch (
final Throwable t) {
99 Assume.assumeNoException(t);
112 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
115 frame.setVisible(
false);
116 frame.remove(glCanvas);
119 }
catch (
final Throwable t) {
121 Assume.assumeNoException(t);
125 @Test(timeout = 10000)
126 public
void test01NoDeadlock() throws InterruptedException {
128 System.out.println(
"GLProfile Default: "+glp);
131 runTestGL(caps,
false);
133 System.out.println(
"not a GL2ES2 profile");
137 @Test(timeout = 10000)
138 public
void test02TriggerDeadlock() throws InterruptedException {
140 System.out.println(
"GLProfile Default: "+glp);
143 runTestGL(caps,
true);
145 System.out.println(
"not a GL2ES2 profile");
149 public static void main(
final String args[]) {
NEWT Window events are provided for notification purposes ONLY.
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
final boolean isGL2ES2()
Indicates whether this profile is capable of GL2ES2.
static String glAvailabilityToString(final AbstractGraphicsDevice device)
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
A heavyweight AWT component which provides OpenGL rendering support.
void addGLEventListener(final GLEventListener listener)
Adds the given listener to the end of this drawable queue.
void runTestGL(final GLCapabilities caps, final boolean triggerDeadlock)
static void main(final String args[])
static boolean waitForRealized(final java.awt.Component comp, final boolean realized, final Runnable waitAction)
static boolean waitForContextCreated(final GLAutoDrawable autoDrawable, final boolean created, final Runnable waitAction)
final int getTotalFPSFrames()
final void setUpdateFPSFrames(final int frames, final PrintStream out)
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.