29package com.jogamp.opengl.test.junit.jogl.awt;
31import com.jogamp.opengl.awt.GLCanvas;
32import com.jogamp.opengl.util.Animator;
34import com.jogamp.opengl.test.junit.util.UITestCase;
35import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
37import com.jogamp.opengl.test.junit.util.MiscUtils;
39import java.awt.Dimension;
41import java.lang.reflect.InvocationTargetException;
43import org.junit.Assert;
45import org.junit.FixMethodOrder;
46import org.junit.runners.MethodSorters;
49@FixMethodOrder(MethodSorters.NAME_ASCENDING)
51 static long durationPerTest = 500;
54 public void testAddRemove() throws InterruptedException, InvocationTargetException {
55 final Dimension f_sz =
new Dimension(512, 512);
58 Assert.assertNotNull(glCanvas);
64 final Frame frame =
new Frame(
"Frame");
65 Assert.assertNotNull(frame);
68 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
70 frame.setLocation(0, 0);
71 frame.setPreferredSize(f_sz);
74 frame.setVisible(
true);
76 Thread.sleep(durationPerTest/2);
78 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
80 frame.remove(glCanvas);
85 Thread.sleep(durationPerTest/2);
87 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
96 public static void main(
final String args[]) {
97 for(
int i=0; i<args.length; i++) {
98 if(args[i].equals(
"-time")) {
99 durationPerTest =
MiscUtils.
atoi(args[++i], (
int)durationPerTest);
A heavyweight AWT component which provides OpenGL rendering support.
void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext....
void addGLEventListener(final GLEventListener listener)
Adds the given listener to the end of this drawable queue.
static void main(final String args[])
static int atoi(final String str, final int def)
final synchronized boolean start()
Starts this animator, if not running.
final synchronized boolean stop()
Stops this animator.