summaryrefslogtreecommitdiffstats
path: root/maven/tests/test-jogl-all
diff options
context:
space:
mode:
authorMark Raynsford <[email protected]>2014-07-11 19:09:32 +0000
committerMark Raynsford <[email protected]>2014-07-11 19:09:32 +0000
commit6c2d8d425df5436663f85a5cf0a5396ae3de7d6f (patch)
treeb3fc7345e4494517327832306b8b4317a2050228 /maven/tests/test-jogl-all
parentc386cf285bfaf797c6779189c09e42d68e43b102 (diff)
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
Diffstat (limited to 'maven/tests/test-jogl-all')
-rw-r--r--maven/tests/test-jogl-all/pom.in74
-rw-r--r--maven/tests/test-jogl-all/src/test/java/org/jogamp/maven/tests/TestNEWT.java91
2 files changed, 165 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <!-- Auto generated by pom.sh - Do not edit! -->
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jogamp.maven</groupId>
+ <artifactId>tests</artifactId>
+ <version>JOGAMP_VERSION</version>
+ </parent>
+
+ <artifactId>test-jogl-all</artifactId>
+ <packaging>jar</packaging>
+ <description>Test suite for Maven packages</description>
+ <url>http://jogamp.org/</url>
+
+ <repositories>
+ <repository>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ <id>tests</id>
+ <url>REPOSITORY_URL</url>
+ </repository>
+ </repositories>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jogamp.jogl</groupId>
+ <artifactId>jogl-all-main</artifactId>
+ <version>JOGAMP_VERSION</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jogamp.gluegen</groupId>
+ <artifactId>gluegen-rt-main</artifactId>
+ <version>JOGAMP_VERSION</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <build>
+ <plugins>
+ <!-- Require JDK >= 1.6 -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
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();
+ }
+}