1package com.jogamp.opengl.test.junit.jogl.acore;
3import jogamp.nativewindow.x11.X11Util;
4import org.junit.Assert;
6import org.junit.FixMethodOrder;
7import org.junit.runners.MethodSorters;
9import com.jogamp.nativewindow.NativeWindowFactory;
10import com.jogamp.opengl.GLCapabilities;
11import com.jogamp.opengl.GLCapabilitiesImmutable;
12import com.jogamp.opengl.GLProfile;
13import com.jogamp.opengl.awt.GLCanvas;
19@FixMethodOrder(MethodSorters.NAME_ASCENDING)
26 for (
int j = 0; j < 10; j++ ) {
29 open0 = X11Util.getOpenDisplayConnectionNumber();
35 final Frame frame =
new Frame(
"AWT Resource X11 Leak - #" + j );
38 frame.add( glCanvas );
41 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
43 frame.setSize( 128, 128 );
44 frame.setVisible(
true );
48 catch (
final Throwable t ) {
50 Assert.fail(t.getMessage());
54 javax.swing.SwingUtilities.invokeAndWait(
new Runnable() {
56 frame.setVisible(
false );
57 frame.remove( glCanvas );
62 catch (
final Throwable t ) {
64 Assert.fail(t.getMessage());
68 final int openD = X11Util.getOpenDisplayConnectionNumber() - open0;
70 X11Util.dumpOpenDisplayConnections();
71 X11Util.dumpPendingDisplayConnections();
72 Assert.assertTrue(
"More than 1 new open display connections",
false);
77 catch (
final Exception e ) {
79 Assert.fail(e.getMessage());
84 public static void main(
final String args[]) {
Provides a pluggable mechanism for arbitrary window toolkits to adapt their components to the NativeW...
static final String TYPE_X11
X11 type, as retrieved with getNativeWindowType(boolean).
static String getNativeWindowType(final boolean useCustom)
Specifies a set of OpenGL capabilities.
Specifies the the OpenGL profile.
static GLProfile getDefault(final AbstractGraphicsDevice device)
Returns a default GLProfile object, reflecting the best for the running platform.
static void initSingleton()
Static initialization of JOGL.
A heavyweight AWT component which provides OpenGL rendering support.
Tests the closing the device of GLCanvas in JOGL.
static void main(final String args[])
void testX11WindowMemoryLeak()
Specifies an immutable set of OpenGL capabilities.