summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-02-19 20:08:52 +0100
committerSven Gothel <[email protected]>2013-02-19 20:08:52 +0100
commite7df5d65e83e07bf7e8474aebcf9fd09f3597527 (patch)
treef611017799e54ae3127e11545a2d7c1b8bbf8736 /src/test
parent85338858f5c58694fa88e77df1386d0556887944 (diff)
Unit Tests NewtEventModifiers: Attempt to make them more robust for that one particular Windows-AMD Test Node
- Adding 'waitForVisible' and 'waitForRealized' on the GLAutoDrawable before test - Adding clearKeyboadAndMouse before test
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java2
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java12
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java7
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java6
-rw-r--r--src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWT.java3
5 files changed, 21 insertions, 9 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
index 31fa11e9d..f5278a542 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
@@ -677,7 +677,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
////////////////////////////////////////////////////////////////////////////
- public static void baseAfterClass() throws Exception {
+ public static void clearKeyboadAndMouse() throws Exception {
// Make sure all modifiers are released, otherwise the user's
// desktop can get locked up (ask me how I know this).
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
index 17f81c583..ee634e1c6 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
@@ -62,25 +62,29 @@ public class TestNewtEventModifiersAWTCanvas extends BaseNewtEventModifiers {
_testFrame = new JFrame( "Event Modifier Test AWTCanvas" ) ;
_testFrame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ) ;
- _testFrame.getContentPane().add( canvas ) ;
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
+ _testFrame.getContentPane().add( canvas ) ;
_testFrame.setBounds( TEST_FRAME_X, TEST_FRAME_Y, TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT ) ;
_testFrame.setVisible( true ) ;
}
}) ;
- Assert.assertEquals(true, AWTRobotUtil.waitForVisible(_testFrame, true));
+ Assert.assertEquals(true, AWTRobotUtil.waitForVisible(_testFrame, true));
+ Assert.assertTrue(AWTRobotUtil.waitForVisible(canvas, true));
+ Assert.assertTrue(AWTRobotUtil.waitForRealized(canvas, true));
+
AWTRobotUtil.assertRequestFocusAndWait(null, canvas, canvas, null, null); // programmatic
Assert.assertNotNull(_robot);
- AWTRobotUtil.requestFocus(_robot, canvas, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
+ AWTRobotUtil.requestFocus(_robot, canvas, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
+ clearKeyboadAndMouse();
}
////////////////////////////////////////////////////////////////////////////
@AfterClass
public static void afterClass() throws Exception {
- baseAfterClass();
+ clearKeyboadAndMouse();
SwingUtilities.invokeAndWait(new Runnable() {
public void run() {
_testFrame.dispose() ;
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
index 5428958a0..880d378a4 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
@@ -58,17 +58,20 @@ public class TestNewtEventModifiersNEWTWindowAWT extends BaseNewtEventModifiers
_glWindow.setPosition(TEST_FRAME_X, TEST_FRAME_Y);
_glWindow.setVisible(true);
- Assert.assertEquals(true, AWTRobotUtil.waitForRealized(_glWindow, true));
+ Assert.assertTrue(AWTRobotUtil.waitForVisible(_glWindow, true));
+ Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));
+
AWTRobotUtil.assertRequestFocusAndWait(null, _glWindow, _glWindow, null, null); // programmatic
Assert.assertNotNull(_robot);
AWTRobotUtil.requestFocus(_robot, _glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
+ clearKeyboadAndMouse();
}
////////////////////////////////////////////////////////////////////////////
@AfterClass
public static void afterClass() throws Exception {
- baseAfterClass();
+ clearKeyboadAndMouse();
_glWindow.destroy();
}
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
index 6a3f4a54b..47826d127 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
@@ -82,18 +82,22 @@ public class TestNewtEventModifiersNewtCanvasAWT extends BaseNewtEventModifiers
}
} ) ;
Assert.assertEquals(true, AWTRobotUtil.waitForVisible(_testFrame, true));
+ Assert.assertTrue(AWTRobotUtil.waitForVisible(_glWindow, true));
+ Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));
+
AWTRobotUtil.assertRequestFocusAndWait(null, _glWindow, _glWindow, null, null); // programmatic
Assert.assertNotNull(_robot);
AWTRobotUtil.requestFocus(_robot, _glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
_glWindow.addMouseListener( _testMouseListener ) ;
+ clearKeyboadAndMouse();
}
////////////////////////////////////////////////////////////////////////////
@AfterClass
public static void afterClass() throws Exception {
- baseAfterClass();
+ clearKeyboadAndMouse();
SwingUtilities.invokeAndWait( new Runnable() {
public void run() {
_testFrame.dispose() ;
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWT.java
index cafc3dd46..0ac9328a6 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWT.java
@@ -133,13 +133,14 @@ public class TestNewtEventModifiersNewtCanvasSWT extends BaseNewtEventModifiers
eventDispatch2xImpl();
_glWindow.addMouseListener( _testMouseListener ) ;
+ clearKeyboadAndMouse();
}
////////////////////////////////////////////////////////////////////////////
@AfterClass
public static void afterClass() throws Exception {
- baseAfterClass();
+ clearKeyboadAndMouse();
_glWindow.destroy() ;