diff options
author | Sven Gothel <[email protected]> | 2010-04-09 04:30:24 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-09 04:30:24 +0200 |
commit | a9eaf11b0d168db049bafc24260d6c0b4a000071 (patch) | |
tree | d7388ddfdfa7263c4feeee7b6b746a29eac9c113 /src/junit | |
parent | 9ae88158f66b48b257e417c3973ce010c1fc45a8 (diff) |
junit: Add timeout (30s), enable offscreen test
Diffstat (limited to 'src/junit')
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java | 25 | ||||
-rwxr-xr-x | src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java | 10 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java index a8caafb30..5800af9af 100755 --- a/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java @@ -65,8 +65,26 @@ public class TestOffscreen01NEWT { } @Test - public void test1() { - if(false) { + public void test01OffscreenWindow() { + if(true) { + GLWindow windowOffscreen = WindowUtilNEWT.createGLWindow(caps, width, height, false, true, false); + GLEventListener demo = new RedSquare(); + GLWindow windowOnScreen = null; + WindowListener wl=null; + MouseListener ml=null; + SurfaceUpdatedListener ul=null; + + WindowUtilNEWT.run(windowOffscreen, null, windowOnScreen, wl, ml, ul, 2, true /*debug*/); + try { + Thread.sleep(1000); // 1000 ms + } catch (Exception e) {} + WindowUtilNEWT.shutdown(windowOffscreen, windowOnScreen); + } + } + + @Test + public void test02OffscreenSnapshotWithDemo() { + if(true) { GLWindow windowOffscreen = WindowUtilNEWT.createGLWindow(caps, width, height, false, true, false); GLEventListener demo = new RedSquare(); GLWindow windowOnScreen = null; @@ -75,6 +93,9 @@ public class TestOffscreen01NEWT { SurfaceUpdatedListener ul=null; WindowUtilNEWT.run(windowOffscreen, demo, windowOnScreen, wl, ml, ul, 2, true /*debug*/); + try { + Thread.sleep(1000); // 1000 ms + } catch (Exception e) {} WindowUtilNEWT.shutdown(windowOffscreen, windowOnScreen); } } diff --git a/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java b/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java index 31ee7b552..b9541dbaf 100755 --- a/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java +++ b/src/junit/com/jogamp/test/junit/jogl/offscreen/WindowUtilNEWT.java @@ -79,14 +79,16 @@ public class WindowUtilNEWT { GLWindow windowOnScreen, WindowListener wl, MouseListener ml, SurfaceUpdatedListener ul, int frames, boolean debug) { try { - if(debug) { + if(debug && null!=demo) { MiscUtils.setField(demo, "glDebug", new Boolean(true)); MiscUtils.setField(demo, "glTrace", new Boolean(true)); } - if(!MiscUtils.setField(demo, "window", windowOffscreen)) { - MiscUtils.setField(demo, "glWindow", windowOffscreen); + if(null!=demo) { + if(!MiscUtils.setField(demo, "window", windowOffscreen)) { + MiscUtils.setField(demo, "glWindow", windowOffscreen); + } + windowOffscreen.addGLEventListener(demo); } - windowOffscreen.addGLEventListener(demo); if ( null != windowOnScreen ) { if(null!=wl) { |