diff options
author | Sven Gothel <[email protected]> | 2012-09-16 15:39:10 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-09-16 15:39:10 +0200 |
commit | f2bd50ff25009de477a203460abe8a5597acdbc5 (patch) | |
tree | 9746290ec888ff84d9d3954a55203e0d13e91f09 | |
parent | 266d0ba5a4acde851dab3abd7dfe4b72542d0675 (diff) |
Adding test case for Bug 611: On Windows XP is a performance issue, after JOGL initialization there seems to be a huge time lag when trying to open the Desktop folder.
-rwxr-xr-x | make/scripts/tests.sh | 11 | ||||
-rw-r--r-- | src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java | 81 |
2 files changed, 87 insertions, 5 deletions
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index 5051979d5..724b7df97 100755 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -35,10 +35,10 @@ if [ $MOSX -eq 1 ] ; then echo setup OSX environment vars export NSZombieEnabled=YES export NSTraceEvents=YES - export OBJC_PRINT_EXCEPTIONS=YES - echo NSZombieEnabled $NSZombieEnabled - echo NSTraceEvents $NSTraceEvents - echo OBJC_PRINT_EXCEPTIONS $OBJC_PRINT_EXCEPTIONS + #export OBJC_PRINT_EXCEPTIONS=YES + echo NSZombieEnabled $NSZombieEnabled 2>&1 | tee -a java-run.log + echo NSTraceEvents $NSTraceEvents 2>&1 | tee -a java-run.log + echo OBJC_PRINT_EXCEPTIONS $OBJC_PRINT_EXCEPTIONS 2>&1 | tee -a java-run.log MOSX_MT=1 fi @@ -253,7 +253,7 @@ function testawtswt() { #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableFactoryOffscrnCapsNEWT $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer01GLCanvasAWT $* -testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer02NewtCanvasAWT $* +#testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer02NewtCanvasAWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestFBOAutoDrawableFactoryNEWT $* #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestFBOOffThreadSharedContextMix2DemosES2NEWT $* @@ -304,6 +304,7 @@ testawt com.jogamp.opengl.test.junit.jogl.acore.TestOffscreenLayer02NewtCanvasAW #testawt javax.media.opengl.awt.GLCanvas $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLCanvasAWT $* #testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug551AWT $* +testawt com.jogamp.opengl.test.junit.jogl.awt.TestBug611AWT $* #testawt com.jogamp.opengl.test.junit.jogl.awt.TestAWT01GLn $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestAWTCloseX11DisplayBug565 $* #testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT $* diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java new file mode 100644 index 000000000..b6a7639bd --- /dev/null +++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java @@ -0,0 +1,81 @@ + +package com.jogamp.opengl.test.junit.jogl.awt; + +import java.awt.Desktop; +import java.io.File; + +import javax.media.opengl.GLProfile; + +import org.junit.Test; + +import com.jogamp.common.os.Platform; +import com.jogamp.opengl.test.junit.util.UITestCase; + +/** + * As reported in Bug 611, on Windows XP is a performance issue: + * After JOGL initialization there seems to be a huge time lag + * when trying to open the Desktop folder. + * <p> + * Test disabled since showing the Desktop folder will + * disturb the 'desktop' .. if there is another way to show + * the performance bug, pls do so. + * </p> + * <p> + * Since Windows XP is out of life .. we may not care .. + * </p> + */ +public class TestBug611AWT extends UITestCase { + + @Test + public void test00() { + // make junit happy + } + + // @Test + public void test01() { + try { + // System.setProperty("jogamp.gluegen.UseTempJarCache", "false"); + GLProfile.initSingleton(); + Desktop desktop; + if (Desktop.isDesktopSupported()) { + desktop = Desktop.getDesktop(); + } else { + desktop = null; + } + if(null != desktop) { + String home = System.getProperty("user.home"); + File homeFolder = null; + if(null != home) { + { + File tst = new File(home + "/Desktop"); + if( tst.canRead() ) { + homeFolder = tst; + } + } + if(null == homeFolder) { + File tst = new File(home); + if( tst.canRead() ) { + homeFolder = tst; + } + } + } + if(null == homeFolder) { + if(Platform.getOSType() == Platform.OSType.WINDOWS) { + homeFolder = new File("c:\\"); + } else { + homeFolder = new File("/"); + } + } + if(null != homeFolder) { + desktop.open(homeFolder); + } + } + } catch(Exception ex) { + ex.printStackTrace(); + } + } + + public static void main(String args[]) { + org.junit.runner.JUnitCore.main(TestBug611AWT.class.getName()); + } +} |