From 01c5d59c5245068b0d005ccbb64f8d0aa5165f12 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 1 Oct 2013 22:41:55 +0200 Subject: Bug 846: Add manual test case for One-Jar (using 0.97.1) Note: One-Jar lacks support of a URL handler for it's jar-in-jar files and hence we would need to extract the jar-in-jar resources w/ our TempJarCache from one one-jar file .. too bad. Looks like it's incomplete. --- test/TestOneJar_InJar/jogamp01/build.xml | 123 +++++++++++++++++++++ .../jogamp01/ide/eclipse/jogamp01-suite.launch | 26 +++++ .../eclipse/test-jogamp01 (JarLaunch build).launch | 12 ++ .../jogamp01/junit/jogamp/test/Jogamp01Suite.java | 73 ++++++++++++ test/TestOneJar_InJar/jogamp01/lib/README.txt | 1 + .../jogamp01/one-jar/build.onejar.xml | 54 +++++++++ .../one-jar/dist/one-jar-ant-task-0.97.jar | Bin 0 -> 92003 bytes .../jogamp01/one-jar/dist/one-jar-ant-task.xml | 10 ++ .../jogamp01/one-jar/dist/one-jar-boot-0.97.jar | Bin 0 -> 69299 bytes .../jogamp01/one-jar/lib/junit-3.8.1.jar | Bin 0 -> 121070 bytes .../jogamp01/src/jogamp/main/Jogamp01Main.java | 31 ++++++ .../jogamp01/test/jogamp/test/Test.java | 32 ++++++ 12 files changed, 362 insertions(+) create mode 100644 test/TestOneJar_InJar/jogamp01/build.xml create mode 100644 test/TestOneJar_InJar/jogamp01/ide/eclipse/jogamp01-suite.launch create mode 100644 test/TestOneJar_InJar/jogamp01/ide/eclipse/test-jogamp01 (JarLaunch build).launch create mode 100644 test/TestOneJar_InJar/jogamp01/junit/jogamp/test/Jogamp01Suite.java create mode 100644 test/TestOneJar_InJar/jogamp01/lib/README.txt create mode 100644 test/TestOneJar_InJar/jogamp01/one-jar/build.onejar.xml create mode 100644 test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task-0.97.jar create mode 100644 test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task.xml create mode 100644 test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-boot-0.97.jar create mode 100644 test/TestOneJar_InJar/jogamp01/one-jar/lib/junit-3.8.1.jar create mode 100644 test/TestOneJar_InJar/jogamp01/src/jogamp/main/Jogamp01Main.java create mode 100644 test/TestOneJar_InJar/jogamp01/test/jogamp/test/Test.java (limited to 'test/TestOneJar_InJar/jogamp01') diff --git a/test/TestOneJar_InJar/jogamp01/build.xml b/test/TestOneJar_InJar/jogamp01/build.xml new file mode 100644 index 0000000..e1a4b24 --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/build.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ + + + + + +
+ +
+ + + +
+ +
+ + + + + + + + + + + ********** junit-jogamp01.jar + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/test/TestOneJar_InJar/jogamp01/ide/eclipse/jogamp01-suite.launch b/test/TestOneJar_InJar/jogamp01/ide/eclipse/jogamp01-suite.launch new file mode 100644 index 0000000..b3e5c70 --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/ide/eclipse/jogamp01-suite.launch @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/TestOneJar_InJar/jogamp01/ide/eclipse/test-jogamp01 (JarLaunch build).launch b/test/TestOneJar_InJar/jogamp01/ide/eclipse/test-jogamp01 (JarLaunch build).launch new file mode 100644 index 0000000..e532dd3 --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/ide/eclipse/test-jogamp01 (JarLaunch build).launch @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/test/TestOneJar_InJar/jogamp01/junit/jogamp/test/Jogamp01Suite.java b/test/TestOneJar_InJar/jogamp01/junit/jogamp/test/Jogamp01Suite.java new file mode 100644 index 0000000..85ac9c0 --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/junit/jogamp/test/Jogamp01Suite.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com) + * All rights reserved. + * + * See the full license at http://one-jar.sourceforge.net/one-jar-license.html + * This license is also included in the distributions of this software + * under doc/one-jar-license.txt + */ +package jogamp.test; + +import java.lang.reflect.Method; + +import junit.framework.AssertionFailedError; +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestResult; +import junit.framework.TestSuite; + +import com.simontuffs.onejar.Boot; +import com.simontuffs.onejar.JarClassLoader; +import com.simontuffs.onejar.test.Invoker; + +public class Jogamp01Suite { + + protected static Object test; + protected static int failures = 0; + + public static final String MAIN_CLASS = "jogamp.test.Test"; + + public static void main(String args[]) { + new TestSuite(Jogamp01Suite.class).run(new TestResult()); + } + + public static Test suite() throws Exception { + if (test == null) { + // Load Test object from the jar. + JarClassLoader loader = new JarClassLoader(""); + Boot.setClassLoader(loader); + // loader.setVerbose(true); + loader.load(null); + test = loader.loadClass(MAIN_CLASS).newInstance(); + } + TestSuite top = new TestSuite(); + TestSuite suite = new TestSuite(MAIN_CLASS); + top.addTest(suite); + Method methods[] = test.getClass().getMethods(); + for (final Method method: methods) { + if (method.getName().startsWith("test")) { + System.out.println("" + method); + suite.addTest(new TestCase() { + { + setName(method.getName()); + } + @Override + public void run(TestResult result) { + // TODO Auto-generated method stub + result.startTest(this); + try { + Invoker.invoke(test, method.getName()); + } catch (Exception x) { + x.printStackTrace(); + result.addFailure(this, new AssertionFailedError(x.toString())); + } + result.endTest(this); + } + }); + } + } + + return suite; + } + +} diff --git a/test/TestOneJar_InJar/jogamp01/lib/README.txt b/test/TestOneJar_InJar/jogamp01/lib/README.txt new file mode 100644 index 0000000..3c862b9 --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/lib/README.txt @@ -0,0 +1 @@ +Place your libraries to be included in the One-Jar archive here. diff --git a/test/TestOneJar_InJar/jogamp01/one-jar/build.onejar.xml b/test/TestOneJar_InJar/jogamp01/one-jar/build.onejar.xml new file mode 100644 index 0000000..8c41ade --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/one-jar/build.onejar.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + *********************************************** + * Report is in ${test.reports.dir}/junit_noframes.html + *********************************************** + + + + + diff --git a/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task-0.97.jar b/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task-0.97.jar new file mode 100644 index 0000000..15dbbb2 Binary files /dev/null and b/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task-0.97.jar differ diff --git a/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task.xml b/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task.xml new file mode 100644 index 0000000..007b5ad --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-ant-task.xml @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-boot-0.97.jar b/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-boot-0.97.jar new file mode 100644 index 0000000..26e0ec6 Binary files /dev/null and b/test/TestOneJar_InJar/jogamp01/one-jar/dist/one-jar-boot-0.97.jar differ diff --git a/test/TestOneJar_InJar/jogamp01/one-jar/lib/junit-3.8.1.jar b/test/TestOneJar_InJar/jogamp01/one-jar/lib/junit-3.8.1.jar new file mode 100644 index 0000000..674d71e Binary files /dev/null and b/test/TestOneJar_InJar/jogamp01/one-jar/lib/junit-3.8.1.jar differ diff --git a/test/TestOneJar_InJar/jogamp01/src/jogamp/main/Jogamp01Main.java b/test/TestOneJar_InJar/jogamp01/src/jogamp/main/Jogamp01Main.java new file mode 100644 index 0000000..b8ee4e1 --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/src/jogamp/main/Jogamp01Main.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com) + * All rights reserved. + * + * See the full license at http://one-jar.sourceforge.net/one-jar-license.html + * This license is also included in the distributions of this software + * under doc/one-jar-license.txt + */ +package jogamp.main; + +import java.util.Arrays; + +public class Jogamp01Main { + + public static void main(String args[]) { + if (args == null) + args = new String[0]; + System.out.println("jogamp01 main entry point, args=" + Arrays.asList(args)); + new Jogamp01Main().run(); + } + + // Bring up the application: only expected to exit when user interaction + // indicates so. + public void run() { + System.out.println("jogamp01 main is running"); + // Implement the functionality of the application. + System.out.println("jogamp01 OK."); + } + + +} diff --git a/test/TestOneJar_InJar/jogamp01/test/jogamp/test/Test.java b/test/TestOneJar_InJar/jogamp01/test/jogamp/test/Test.java new file mode 100644 index 0000000..87e987f --- /dev/null +++ b/test/TestOneJar_InJar/jogamp01/test/jogamp/test/Test.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2004-2010, P. Simon Tuffs (simon@simontuffs.com) + * All rights reserved. + * + * See the full license at http://one-jar.sourceforge.net/one-jar-license.html + * This license is also included in the distributions of this software + * under doc/one-jar-license.txt + */ +package jogamp.test; + +import com.simontuffs.onejar.test.Testable; + +public class Test extends Testable { + + public static void main(String args[]) throws Exception { + Test test = new Test(); + test.runTests(); + } + + // Test other aspects of the application at unit level (e.g. library + // methods). + public void testJogamp011() { + System.out.println("testJogamp011: OK"); + } + public void testJogamp012() { + System.out.println("testJogamp012: OK"); + } + public void testJogamp013() { + System.out.println("testJogamp013: OK"); + } + +} -- cgit v1.2.3