From 6c2d8d425df5436663f85a5cf0a5396ae3de7d6f Mon Sep 17 00:00:00 2001 From: Mark Raynsford Date: Fri, 11 Jul 2014 19:09:32 +0000 Subject: Add jogl-main, nativewindow-main, newt-main - frontends for the atomics packages that allow for pulling in all platform natives easily. Add test suite. Bug: 1023 --- maven/tests/test-jogl-all/pom.in | 74 ++++++++++++++++++ .../test/java/org/jogamp/maven/tests/TestNEWT.java | 91 ++++++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 maven/tests/test-jogl-all/pom.in create mode 100644 maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java (limited to 'maven/tests/test-jogl-all') diff --git a/maven/tests/test-jogl-all/pom.in b/maven/tests/test-jogl-all/pom.in new file mode 100644 index 0000000..1e0f98c --- /dev/null +++ b/maven/tests/test-jogl-all/pom.in @@ -0,0 +1,74 @@ + + + + + + 4.0.0 + + + org.jogamp.maven + tests + JOGAMP_VERSION + + + test-jogl-all + jar + Test suite for Maven packages + http://jogamp.org/ + + + + + true + + tests + REPOSITORY_URL + + + + + + junit + junit + 4.11 + test + + + + org.jogamp.jogl + jogl-all-main + JOGAMP_VERSION + test + + + org.jogamp.gluegen + gluegen-rt-main + JOGAMP_VERSION + test + + + + + UTF-8 + UTF-8 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.6 + 1.6 + + + + + + diff --git a/maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java b/maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java new file mode 100644 index 0000000..6a01aa1 --- /dev/null +++ b/maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java @@ -0,0 +1,91 @@ +/* + * Copyright 2010 JogAmp Community. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL JogAmp Community OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * The views and conclusions contained in the software and documentation are + * those of the authors and should not be interpreted as representing official + * policies, either expressed or implied, of JogAmp Community. + */ + +package org.jogamp.maven.tests; + +import javax.media.opengl.GL; +import javax.media.opengl.GLAutoDrawable; +import javax.media.opengl.GLCapabilities; +import javax.media.opengl.GLEventListener; +import javax.media.opengl.GLProfile; + +import org.junit.Test; + +import com.jogamp.newt.opengl.GLWindow; + +@SuppressWarnings("static-method") public final class TestNEWT +{ + @Test public void testOpen() + throws InterruptedException + { + final GLProfile pro = GLProfile.get(GLProfile.GL3); + final GLCapabilities caps = new GLCapabilities(pro); + final GLWindow window = GLWindow.create(caps); + + window.setSize(640, 480); + window.addGLEventListener(new GLEventListener() { + @Override public void reshape( + final GLAutoDrawable drawable, + final int w, + final int h, + final int x, + final int y) + { + // Nothing + } + + @Override public void init( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void dispose( + final GLAutoDrawable drawable) + { + // Nothing + } + + @Override public void display( + final GLAutoDrawable drawable) + { + final GL gl = drawable.getGL(); + gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f); + gl.glClear(GL.GL_COLOR_BUFFER_BIT); + } + }); + + window.display(); + window.setVisible(true); + Thread.sleep(1000); + window.setVisible(false); + window.destroy(); + } +} -- cgit v1.2.3