29package com.jogamp.opengl.test.junit.jogl.acore;
31import java.io.IOException;
32import java.lang.reflect.InvocationTargetException;
34import com.jogamp.opengl.GLCapabilities;
35import com.jogamp.opengl.GLProfile;
37import org.junit.AfterClass;
38import org.junit.Assert;
39import org.junit.BeforeClass;
41import org.junit.FixMethodOrder;
42import org.junit.runners.MethodSorters;
44import com.jogamp.newt.opengl.GLWindow;
45import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
46import com.jogamp.opengl.test.junit.util.MiscUtils;
47import com.jogamp.opengl.test.junit.util.UITestCase;
49@FixMethodOrder(MethodSorters.NAME_ASCENDING)
51 static long durationPerTest = 50;
52 static int addRemoveCount = 15;
53 static int pauseEach = 0;
54 static int pauseDuration = 500;
56 static int width, height;
57 static boolean waitForKey =
false;
63 Assert.assertNotNull(glp);
67 setTestSupported(
false);
76 throws InterruptedException, InvocationTargetException
79 for(
int i=0; i<addRemoveOpCount; i++) {
80 System.err.println(
"Loop # "+i+
" / "+addRemoveCount);
82 Assert.assertNotNull(glw);
91 final long t0 = System.currentTimeMillis();
95 }
while ( ( System.currentTimeMillis() - t0 ) < durationPerTest ) ;
101 if( 0 < pauseEach && 0 == i % pauseEach ) {
102 System.err.println(
"******* P A U S E ********");
103 Thread.sleep(pauseDuration);
110 throws InterruptedException, InvocationTargetException
113 runTestGL(caps, addRemoveCount);
116 public static void main(
final String args[])
throws IOException {
117 for(
int i=0; i<args.length; i++) {
118 if(args[i].equals(
"-time")) {
121 durationPerTest = Long.parseLong(args[i]);
122 }
catch (
final Exception ex) { ex.printStackTrace(); }
123 }
else if(args[i].equals(
"-loops")) {
126 }
else if(args[i].equals(
"-pauseEach")) {
129 }
else if(args[i].equals(
"-pauseDuration")) {
132 }
else if(args[i].equals(
"-wait")) {
136 System.err.println(
"waitForKey "+waitForKey);
138 System.err.println(
"addRemoveCount "+addRemoveCount);
139 System.err.println(
"pauseEach "+pauseEach);
140 System.err.println(
"pauseDuration "+pauseDuration);
An implementation of GLAutoDrawable and Window interface, using a delegated Window instance,...
final void setTitle(final String title)
final void setSize(final int width, final int height)
Sets the size of the window's client area in window units, excluding decorations.
final void setVisible(final boolean visible)
Calls setVisible(true, visible), i.e.
final void destroy()
Destroys all resources associated with this GLAutoDrawable, inclusive the GLContext.
static GLWindow create(final GLCapabilitiesImmutable caps)
Creates a new GLWindow attaching a new Window referencing a new default Screen and default Display wi...
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static boolean isAvailable(final AbstractGraphicsDevice device, final String profile)
Returns the availability of a profile on a device.
static final String GL2ES2
The intersection of the desktop GL3, GL2 and embedded ES2 profile.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static void releaseClass()
static void main(final String args[])
void runTestGL(final GLCapabilities caps, final int addRemoveOpCount)
GearsES2 setVerbose(final boolean v)
static int atoi(final String str, final int def)
void addGLEventListener(GLEventListener listener)
Adds the given listener to the end of this drawable queue.
GLCapabilitiesImmutable getChosenGLCapabilities()
Fetches the GLCapabilitiesImmutable corresponding to the chosen OpenGL capabilities (pixel format / v...