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 | |
parent | 9ae88158f66b48b257e417c3973ce010c1fc45a8 (diff) |
junit: Add timeout (30s), enable offscreen test
-rw-r--r-- | make/build-junit.xml | 2 | ||||
-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 |
3 files changed, 30 insertions, 7 deletions
diff --git a/make/build-junit.xml b/make/build-junit.xml index 636035f1d..f06035de3 100644 --- a/make/build-junit.xml +++ b/make/build-junit.xml @@ -66,7 +66,7 @@ <target name="junit.run" depends="declare.common"> <!-- Perform the junit tests--> <mkdir dir="${results.junit}" /> - <junit forkmode="once" showoutput="true" fork="true" haltonerror="true"> + <junit forkmode="once" showoutput="true" fork="true" haltonerror="off" timeout="30000"> <env key="${system.env.library.path}" path="${obj.all.paths}"/> <jvmarg value="-Djava.library.path=${obj.all.paths}"/> 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) { |