From bb588480a2978da6b8ffec821821f19eb6a83e40 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 9 Apr 2019 22:20:53 +0200 Subject: Cleanup AWTRobotUtil: Extract GLTestUtil + NewtTestUtil; all three based on TestUtil --- .../jogl/acore/TestFBOAutoDrawableFactoryNEWT.java | 8 +- ...estGLAutoDrawableDelegateOnOffscrnCapsNEWT.java | 7 +- ...estGLAutoDrawableFactoryES2OffscrnCapsNEWT.java | 8 +- ...estGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java | 8 +- ...stGLAutoDrawableFactoryGLProfileDeviceNEWT.java | 6 +- ...TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java | 8 +- ...TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java | 7 +- ...estGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java | 7 +- ...LAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java | 7 +- .../jogl/acore/TestSharedContextNewtAWTBug523.java | 5 +- .../jogl/acore/TestSharedContextVBOES1NEWT.java | 5 +- .../jogl/acore/TestSharedContextVBOES2AWT3.java | 13 +- .../jogl/acore/TestSharedContextVBOES2AWT3b.java | 13 +- .../jogl/acore/TestSharedContextVBOES2NEWT0.java | 9 +- .../jogl/acore/TestSharedContextVBOES2NEWT1.java | 29 ++-- .../jogl/acore/TestSharedContextVBOES2NEWT2.java | 25 +-- .../jogl/acore/TestSharedContextVBOES2NEWT3.java | 21 +-- .../jogl/acore/TestSharedContextVBOES2NEWT4.java | 13 +- .../jogl/acore/TestSharedContextVBOES2SWT3.java | 14 +- .../jogl/acore/anim/TestAnimatorGLJPanel01AWT.java | 13 +- .../acore/anim/TestAnimatorGLWindow01NEWT.java | 13 +- .../demos/gl2/newt/TestGearsNewtAWTWrapper.java | 9 +- .../opengl/test/junit/newt/TestCloseNewtAWT.java | 5 +- .../junit/newt/TestWindowClosingProtocol01AWT.java | 7 +- .../newt/TestWindowClosingProtocol02NEWT.java | 3 +- .../newt/TestWindowClosingProtocol03NewtAWT.java | 7 +- .../event/TestParentingFocus01SwingAWTRobot.java | 2 +- .../event/TestParentingFocus02SwingAWTRobot.java | 4 +- .../opengl/test/junit/util/AWTRobotUtil.java | 179 +++----------------- .../jogamp/opengl/test/junit/util/GLTestUtil.java | 98 +++++++++++ .../opengl/test/junit/util/NewtTestUtil.java | 180 +++++++++++++++++++++ .../jogamp/opengl/test/junit/util/TestUtil.java | 90 +++++++++++ 32 files changed, 536 insertions(+), 287 deletions(-) create mode 100644 src/test/com/jogamp/opengl/test/junit/util/GLTestUtil.java create mode 100644 src/test/com/jogamp/opengl/test/junit/util/NewtTestUtil.java create mode 100644 src/test/com/jogamp/opengl/test/junit/util/TestUtil.java (limited to 'src/test/com') diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java index d122a0709..dfe6fca67 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java @@ -47,7 +47,7 @@ import com.jogamp.opengl.FBObject; import com.jogamp.opengl.test.junit.jogl.demos.es2.FBOMix2DemosES2; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.jogl.demos.es2.MultisampleDemoES2; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -339,7 +339,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); // SWAP_EVEN Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); // - SWAP_ODD glad.display(); // - SWAP_EVEN @@ -387,7 +387,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); // SWAP_ODD Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); // - SWAP_EVEN glad.display(); // - SWAP_ODD @@ -446,7 +446,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase { szStep = 3; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java index bf870b257..cddf002cf 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java @@ -56,6 +56,7 @@ import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -199,7 +200,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -210,7 +211,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -221,7 +222,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java index daa784fbb..81dfe7b73 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java @@ -48,7 +48,7 @@ import org.junit.runners.MethodSorters; import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -128,7 +128,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -136,7 +136,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -144,7 +144,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java index dad7fb1ed..d8e3c8c6e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java @@ -48,7 +48,7 @@ import org.junit.runners.MethodSorters; import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -128,7 +128,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -136,7 +136,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -144,7 +144,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java index 1e264d21a..4ab7c5a2e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLProfileDeviceNEWT.java @@ -48,8 +48,8 @@ import org.junit.runners.MethodSorters; import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; import com.jogamp.opengl.test.junit.util.GLEventListenerCounter; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -104,14 +104,14 @@ public class TestGLAutoDrawableFactoryGLProfileDeviceNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); glad.display(); // 2, 3 (resize + display) szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); glad.display(); Thread.sleep(50); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java index 7e53f9579..0936732bc 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java @@ -48,7 +48,7 @@ import org.junit.runners.MethodSorters; import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -120,7 +120,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { // 1 - szStep = 2 Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -128,7 +128,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { szStep = 1; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -136,7 +136,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase { szStep = 4; glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); + GLTestUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep)); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java index 347463eae..b97de9975 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java @@ -55,6 +55,7 @@ import org.junit.runners.MethodSorters; import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -198,7 +199,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -209,7 +210,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -221,7 +222,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java index bb5861fdc..b95f6d97e 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java @@ -52,6 +52,7 @@ import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -154,7 +155,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -165,7 +166,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -176,7 +177,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase { expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java index 57d3fcb3d..1e05cf276 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java @@ -58,6 +58,7 @@ import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.JoglVersion; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; /** @@ -210,7 +211,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase // 1 - szStep = 2 final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -221,7 +222,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); @@ -233,7 +234,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase expSurfaceSize[1] = heightStep*szStep; glad.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1])); glad.display(); snapshotGLEventListener.setMakeSnapshot(); glad.display(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java index 2a83912b9..cd1cfaced 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java @@ -77,8 +77,9 @@ import com.jogamp.common.nio.Buffers; import com.jogamp.newt.awt.NewtCanvasAWT; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.TestUtil; +import com.jogamp.opengl.test.junit.util.TestUtil.WindowClosingListener; import com.jogamp.opengl.test.junit.util.UITestCase; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener; import com.jogamp.opengl.util.Animator; @@ -553,7 +554,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase { */ public void testContextSharingCreateVisibleDestroy(final boolean useNewt, final boolean shareContext) throws InterruptedException, InvocationTargetException { final JFrame frame = new JFrame("Simple JOGL App for testing context sharing"); - final WindowClosingListener awtClosingListener = AWTRobotUtil.addClosingListener(frame); + final TestUtil.WindowClosingListener awtClosingListener = AWTRobotUtil.addClosingListener(frame); // // GLDrawableFactory factory = GLDrawableFactory.getFactory(GLProfile.get(GLProfile.GL2)); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java index ba7176ad0..2ea167979 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java @@ -41,6 +41,7 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.GLAutoDrawableDelegate; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es1.GearsES1; @@ -104,7 +105,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase { // init and render one frame, which will setup the Gears display lists sharedDrawable.display(); final GLContext ctxM = sharedDrawable.getContext(); - Assert.assertTrue("Master ctx not created", AWTRobotUtil.waitForContextCreated(sharedDrawable, true)); + Assert.assertTrue("Master ctx not created", GLTestUtil.waitForContextCreated(sharedDrawable, true)); Assert.assertTrue("Master Ctx is shared before shared creation", !ctxM.isShared()); Assert.assertTrue("Master Gears is shared", !sharedGears.usesSharedGears()); } @@ -136,7 +137,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase { glWindow.setVisible(true); Assert.assertTrue(AWTRobotUtil.waitForRealized(glWindow, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(glWindow, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(glWindow, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true)); MiscUtils.dumpSharedGLContext("Master Context", sharedDrawable.getContext()); MiscUtils.dumpSharedGLContext("New Context", glWindow.getContext()); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java index bee121126..0b8a69576 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java @@ -39,6 +39,7 @@ import com.jogamp.opengl.awt.GLCanvas; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -137,17 +138,17 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); @@ -284,17 +285,17 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java index 94238503e..8bbce1fba 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java @@ -39,6 +39,7 @@ import com.jogamp.opengl.awt.GLJPanel; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -128,17 +129,17 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); @@ -237,17 +238,17 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java index fcca1884d..2819e05de 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java @@ -40,6 +40,7 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -94,7 +95,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(glWindow, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(glWindow, true)); glWindow.display(); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(glWindow, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true)); Assert.assertTrue("Gears not initialized", gears.waitForInit(true)); return glWindow; @@ -186,7 +187,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { f3.destroy(); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); { final List ctx1Shares = ctx1.getCreatedShares(); final List ctx2Shares = ctx2.getCreatedShares(); @@ -207,7 +208,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { f2.destroy(); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); { final List ctx1Shares = ctx1.getCreatedShares(); final List ctx2Shares = ctx2.getCreatedShares(); @@ -228,7 +229,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase { f1.destroy(); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); { final List ctx1Shares = ctx1.getCreatedShares(); final List ctx2Shares = ctx2.getCreatedShares(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java index 962d10bf4..102a01dff 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java @@ -39,6 +39,7 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -116,7 +117,7 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { // init and render one frame, which will setup the Gears display lists sharedDrawable.display(); final GLContext ctxM = sharedDrawable.getContext(); - Assert.assertTrue("Master ctx not created", AWTRobotUtil.waitForContextCreated(sharedDrawable, true)); + Assert.assertTrue("Master ctx not created", GLTestUtil.waitForContextCreated(sharedDrawable, true)); Assert.assertTrue("Master Ctx is shared before shared creation", !ctxM.isShared()); Assert.assertTrue("Master Gears not initialized", sharedGears.waitForInit(true)); System.err.println("Master Gears Init done: "+sharedGears); @@ -151,7 +152,7 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { glWindow.setVisible(true); Assert.assertTrue(AWTRobotUtil.waitForRealized(glWindow, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(glWindow, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(glWindow, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(glWindow, true)); final GLContext sharedMasterContext = sharedDrawable.getContext(); MiscUtils.dumpSharedGLContext("Master Context", sharedMasterContext); @@ -193,13 +194,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); releaseShared(); } @@ -231,13 +232,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); releaseShared(); } @@ -264,13 +265,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); releaseShared(); } @@ -302,13 +303,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase { f3.destroy(); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); releaseShared(); } diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java index 83138c44b..4606c37db 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java @@ -39,6 +39,7 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -130,31 +131,31 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); f1.setVisible(true); // kick off f1 GLContext .. and hence allow f2 + f3 creation Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); @@ -252,30 +253,30 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); f1.setVisible(true); // kicks off f1 GLContext .. and hence gears of f2 + f3 completion Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java index 6fd11c033..5eef967dc 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java @@ -39,6 +39,7 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -131,22 +132,22 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); f1.setVisible(true); // kicks off f1 GLContext .. and hence gears of f2 + f3 completion Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); final GearsES2 g3 = new GearsES2(0); @@ -159,7 +160,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); @@ -269,22 +270,22 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); f1.setVisible(true); // test pending creation of f2 Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); final Animator a3 = new Animator(); @@ -299,7 +300,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = f1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java index 61d109ba1..a89f1bcd0 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT4.java @@ -42,6 +42,7 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -134,31 +135,31 @@ public class TestSharedContextVBOES2NEWT4 extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, false)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, false)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, false)); f1.setVisible(true); // kick off f1 GLContext .. and hence allow f2 + f3 creation Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(f3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(f3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(f3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(f3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); Assert.assertFalse("Unexpected exception (animator) caught", gotAnimException.get()); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java index 84ccfa8b5..248551118 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java @@ -37,7 +37,7 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.nativewindow.swt.SWTAccessor; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.swt.GLCanvas; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -204,13 +204,13 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { Thread.sleep(1000/60*10); // wait ~10 frames giving a chance to create (blocking until master share is valid) - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); @@ -269,7 +269,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { Thread.sleep(1000/60*10); // wait ~10 frames giving a chance to create (blocking until master share is valid) - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); final Animator a2 = new Animator(); @@ -298,10 +298,10 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase { } } ); a3.start(); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); final GLContext ctx1 = c1.getContext(); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java index 8e52ea329..19bd85c7d 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java @@ -36,6 +36,7 @@ import com.jogamp.opengl.awt.GLJPanel; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -118,17 +119,17 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { @@ -220,17 +221,17 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java index 58af4bf2d..f7d383d68 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java @@ -35,6 +35,7 @@ import com.jogamp.opengl.GLCapabilities; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.util.Animator; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; @@ -110,17 +111,17 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { @@ -193,17 +194,17 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase { Assert.assertTrue(AWTRobotUtil.waitForRealized(c1, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c1, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c1, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c1, true)); Assert.assertTrue("Gears1 not initialized", g1.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c2, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c2, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c2, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c2, true)); Assert.assertTrue("Gears2 not initialized", g2.waitForInit(true)); Assert.assertTrue(AWTRobotUtil.waitForRealized(c3, true)); Assert.assertTrue(AWTRobotUtil.waitForVisible(c3, true)); - Assert.assertTrue(AWTRobotUtil.waitForContextCreated(c3, true)); + Assert.assertTrue(GLTestUtil.waitForContextCreated(c3, true)); Assert.assertTrue("Gears3 not initialized", g3.waitForInit(true)); try { diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java index b769e312c..e29e7cfd9 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java @@ -32,8 +32,7 @@ import com.jogamp.nativewindow.*; import com.jogamp.opengl.*; import com.jogamp.opengl.util.Animator; - -import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.GLTestUtil; import com.jogamp.opengl.test.junit.util.MiscUtils; import com.jogamp.opengl.test.junit.util.UITestCase; import com.jogamp.opengl.test.junit.util.QuitAdapter; @@ -97,7 +96,7 @@ public class TestGearsNewtAWTWrapper extends UITestCase { glWindow.display(); final int[] expSurfaceSize = glWindow.getNativeSurface().convertToPixelUnits(new int[] { width/div, height/div }); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); Thread.sleep(600); div = 2; @@ -107,7 +106,7 @@ public class TestGearsNewtAWTWrapper extends UITestCase { expSurfaceSize[1] = height/div; glWindow.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); Thread.sleep(600); div = 1; @@ -117,7 +116,7 @@ public class TestGearsNewtAWTWrapper extends UITestCase { expSurfaceSize[1] = height/div; glWindow.getNativeSurface().convertToPixelUnits(expSurfaceSize); Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(), - AWTRobotUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); + GLTestUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1])); Thread.sleep(600); } diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java index a93aaca79..da6cf66ac 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java @@ -47,8 +47,9 @@ import com.jogamp.newt.Window; import com.jogamp.newt.awt.NewtCanvasAWT; import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.TestUtil; +import com.jogamp.opengl.test.junit.util.TestUtil.WindowClosingListener; import com.jogamp.opengl.test.junit.util.UITestCase; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestCloseNewtAWT extends UITestCase { @@ -114,7 +115,7 @@ public class TestCloseNewtAWT extends UITestCase { }); Assert.assertEquals(true, AWTRobotUtil.waitForVisible(frame, true)); Assert.assertEquals(true, AWTRobotUtil.waitForRealized(newtWindow, true)); - final WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame); + final TestUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame); Assert.assertEquals(true, AWTRobotUtil.closeWindow(frame, true, closingListener)); } 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 57f87ab97..68872b740 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java @@ -46,8 +46,9 @@ import com.jogamp.opengl.awt.GLCanvas; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.TestUtil; +import com.jogamp.opengl.test.junit.util.TestUtil.WindowClosingListener; import com.jogamp.opengl.test.junit.util.UITestCase; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestWindowClosingProtocol01AWT extends UITestCase { @@ -55,7 +56,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase { @Test public void testCloseFrameGLCanvas() throws InterruptedException, InvocationTargetException { final Frame frame = new Frame("testCloseFrameGLCanvas AWT"); - final WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame); + final TestUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame); final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); final GLCanvas glCanvas = new GLCanvas(caps); @@ -115,7 +116,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase { @Test public void testCloseJFrameGLCanvas() throws InterruptedException, InvocationTargetException { final JFrame frame = new JFrame("testCloseJFrameGLCanvas AWT"); - final WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame); + final TestUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame); final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java index 8b639d5da..313a1dfb9 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java @@ -45,6 +45,7 @@ import com.jogamp.newt.opengl.GLWindow; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.TestUtil; import com.jogamp.opengl.test.junit.util.UITestCase; @FixMethodOrder(MethodSorters.NAME_ASCENDING) @@ -55,7 +56,7 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase { final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); final GLWindow glWindow = GLWindow.create(caps); - final AWTRobotUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(glWindow); + final TestUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(glWindow); glWindow.addGLEventListener(new GearsES2()); glWindow.setSize(512, 512); 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 1859a8f87..2661be4a5 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java @@ -47,8 +47,9 @@ import com.jogamp.opengl.GLProfile; import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2; import com.jogamp.opengl.test.junit.util.AWTRobotUtil; +import com.jogamp.opengl.test.junit.util.TestUtil; +import com.jogamp.opengl.test.junit.util.TestUtil.WindowClosingListener; import com.jogamp.opengl.test.junit.util.UITestCase; -import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener; @FixMethodOrder(MethodSorters.NAME_ASCENDING) public class TestWindowClosingProtocol03NewtAWT extends UITestCase { @@ -56,12 +57,12 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase { @Test public void testCloseJFrameNewtCanvasAWT() throws InterruptedException, InvocationTargetException { final JFrame frame = new JFrame("testCloseJFrameNewtCanvasAWT"); - final WindowClosingListener awtClosingListener = AWTRobotUtil.addClosingListener(frame); + final TestUtil.WindowClosingListener awtClosingListener = AWTRobotUtil.addClosingListener(frame); final GLProfile glp = GLProfile.getGL2ES2(); final GLCapabilities caps = new GLCapabilities(glp); final GLWindow glWindow = GLWindow.create(caps); - final AWTRobotUtil.WindowClosingListener newtClosingListener = AWTRobotUtil.addClosingListener(glWindow); + final TestUtil.WindowClosingListener newtClosingListener = AWTRobotUtil.addClosingListener(glWindow); glWindow.addGLEventListener(new GearsES2()); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java index d5ce78ce5..6cebda97a 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java @@ -188,7 +188,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase { // Should be OK to have the AWT component assume it also has the focus. // Assert.assertTrue("Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA, // AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA)); - if( !AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { + if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { System.err.println("Info: Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA); } System.err.println("FOCUS NEWT Canvas/GLWindow sync"); diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java index f9ae91fc8..278ff118b 100644 --- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java +++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java @@ -212,7 +212,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase { // Should be OK to have the AWT component assume it also has the focus. // Assert.assertTrue("Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA, // AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA)); - if( !AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { + if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { System.err.println("Info: Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA); } Assert.assertEquals(false, buttonNorthInnerFA.focusGained()); @@ -252,7 +252,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase { // Should be OK to have the AWT component assume it also has the focus. // Assert.assertTrue("Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA, // AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA)); - if( !AWTRobotUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { + if( !TestUtil.waitForFocus(glWindow1FA, newtCanvasAWTFA) ) { System.err.println("Info: Focus prev. gained, but NewtCanvasAWT didn't loose it. Gainer: "+glWindow1FA+"; Looser "+newtCanvasAWTFA); } diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java index 477b761bd..65ba3239a 100644 --- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java +++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java @@ -42,25 +42,19 @@ import java.awt.Robot; import com.jogamp.nativewindow.NativeWindow; import com.jogamp.nativewindow.NativeWindowFactory; +import com.jogamp.newt.Window; import com.jogamp.opengl.GLAutoDrawable; -import com.jogamp.opengl.GLContext; -import com.jogamp.opengl.GLDrawable; import org.junit.Assert; import com.jogamp.common.ExceptionUtils; import com.jogamp.common.util.awt.AWTEDTExecutor; -import com.jogamp.newt.event.WindowEvent; -public class AWTRobotUtil { +public class AWTRobotUtil extends TestUtil { static final boolean DEBUG = false; - public static final int RETRY_NUMBER = 5; public static final int ROBOT_DELAY = 100; // ms - public static final int TIME_OUT = 2000; // 2s - public static final int POLL_DIVIDER = 20; // TO/20 - public static final int TIME_SLICE = TIME_OUT / POLL_DIVIDER ; public static Integer AWT_CLICK_TO = null; static class OurUncaughtExceptionHandler implements UncaughtExceptionHandler { @@ -385,32 +379,16 @@ public class AWTRobotUtil { return waitvisible within TIME_OUT + */ + public static boolean waitForVisible(final Window win, final boolean visible) throws InterruptedException { + int wait; + for (wait=0; wait