summaryrefslogtreecommitdiffstats
path: root/src/junit/com/jogamp/common/util/TestTempJarCache.java
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'github-mark/master' (Bug 1023, Bug 1024)Sven Gothel2014-07-051-15/+0
|\ | | | | | | | | | | | | | | | | Conflicts: src/java/com/jogamp/common/jvm/JNILibLoaderBase.java src/java/com/jogamp/common/os/Platform.java src/junit/com/jogamp/common/util/TestTempJarCache.java (re-injected that api-doc of addNativeJarLibsImpl)
| * Remove unused addNativeJarLibs() method; the only consumer was a unit testMark Raynsford2014-06-261-15/+0
| | | | | | | | of the method.
* | Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-031-37/+37
|/ | | | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Use org.junit.Assert instead of deprecated junit.framework.AssertSven Gothel2013-10-241-52/+51
|
* Bug 845: Add support for one big-fat jar file [java classes plus all native ↵Sven Gothel2013-10-011-2/+2
| | | | | | | | | | | | | | | | 'os.and.arch' libraries] JNILibLoaderBase.addNativeJarLibsImpl(..): If the modules's jar file contains the folder 'natives/<os.and.arch>/' we assume a big-fat jar and attempt to load all native libraries from the same. The test for above folder is performed via the class ClassLoader's getResource(..) and is considered inexpensive. If the folder exists and native libraries could be loaded, the method returns successfull. Otherwise, the 'slim' jar file is attempted to be loaded, even if such folder exist.
* Fix Bug 844: Cannot ctor URI w/ scheme alone, use string-based concatenation ↵Sven Gothel2013-10-011-1/+1
| | | | native URI root and jar file.
* Bump junit 4.8.2 -> 4.11 (incl. hamcrest 1.2) ; TestTempJarCache uses ↵Sven Gothel2013-08-311-0/+4
| | | | | | | | | | | | | '@FixMethodOrder(MethodSorters.NAME_ASCENDING)' annotation Issue: Java7 unit test order is no more predictable Fix: junit 4.11 performs a determined (not defined default) test order. Additionally user can force ascending method name test order Produced a drop-in junit.jar / junit-source.zip replacement, which includes - junit version version 4.11 - hamcrest-core version 1.3
* Fix Bug 757: Regression of URL to URI conversion (Encoded path not ↵Sven Gothel2013-06-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | compatible w/ file scheme. Regression of (Bug 683, Commit b98825eb7cfb61aead4a7dff57471cd2d2c26823). The URI encoded path cannot be read by File I/O (if file scheme), since the latter requests an UTF8/16 name, not an URI encoded name (i.e. %20 for space). The encoded URL is produced if calling 'uri.toURL()' and hence the new 'IOUtil.toURL(URI)' provides a custom conversion recovering the UTF name via 'new File(uri).getPath()'. Tested w/ - synthetic URI/URL coposition (unit test) - manual w/ moving 'build' to 'build öä lala' for gluegen, joal and jogl. +++ Misc.: - 'URI JarUtil.getURIDirname(URI)' -> 'URI IOUtil.getDirname(URI)' ++
* Fix Bug 683 part1: IOUtil, JarUtil, TempJarCache, .. uses URI instead of URL ↵Sven Gothel2013-06-091-10/+12
| | | | to remove DNS Lookups etc ..
* Implement Bug #598 - JOGL ALL JAR File Change incl. it's Native Jar URL ↵Sven Gothel2012-06-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Derivation +++ JNILibLoaderBase.addNativeJarLibs(..): Add API doc JNILibLoaderBase: "addNativeJarLibs(Class<?> classFromJavaJar, String allNativeJarBaseName, String[] atomicNativeJarBaseNames)" -> "addNativeJarLibs(Class<?>[] classesFromJavaJars, String singleJarMarker, String[] stripBasenameSuffixes)" Derive the 'all' (1st choice) native JAR URL solely on the given class's JAR URL. Examples: JOCL: // only: jocl.jar -> jocl-natives-'os.and.arch'.jar addNativeJarLibs(new Class<?>[] { JOCLJNILibLoader.class }, null, null ); JOGL: final ClassLoader cl = GLProfile.class.getClassLoader(); // either: [jogl-all.jar, jogl-all-noawt.jar, jogl-all-mobile.jar] -> jogl-all-natives-<os.and.arch>.jar // or: nativewindow-core.jar -> nativewindow-natives-<os.and.arch>.jar, // jogl-core.jar -> jogl-natives-<os.and.arch>.jar, // (newt-core.jar -> newt-natives-<os.and.arch>.jar)? (if available) final String newtFactoryClassName = "com.jogamp.newt.NewtFactory"; final Class<?>[] classesFromJavaJars = new Class<?>[] { NWJNILibLoader.class, GLProfile.class, null }; if( ReflectionUtil.isClassAvailable(newtFactoryClassName, cl) ) { classesFromJavaJars[2] = ReflectionUtil.getClass(newtFactoryClassName, false, cl); } JNILibLoaderBase.addNativeJarLibs(classesFromJavaJars, "-all", new String[] { "-noawt", "-mobile", "-core" } ); Efficiency / Performance: - Reduced JAR URL lookup calls JarUtil.getJarURL(..) - JNILibLoaderBase, Platform, JarUtil - Attempt loading Jar files (native, class, ..) only once - TempJarCache Code Cleanup (IOUtil, JarUtil, : - IOException if not found - IllegalArgumentException if null argument +++ jogamp.android-launcher.jar -> jogamp-android-launcher.jar +++
* Don't build and use gluegen.apk (compile time only) ; Don't test classloader ↵Sven Gothel2012-03-071-5/+16
| | | | | | -> JarURL on Android All [remaining] tests passed on Android!
* TestTracer -> JunitTracerv2.0-rc4Sven Gothel2011-12-021-2/+2
|
* Fix Test1p2ProcAddressEmitter (static var); Add TestTracerSven Gothel2011-12-021-1/+2
|
* TempJarCache/JNILibLoaderBase: Identify the Jar files by their URL within ↵Sven Gothel2011-12-011-4/+4
| | | | our lifecycle. JarFile's hash almost always differs.
* JarUtil: Improve Robustness (Bug 522) and API doc, prepare for Jar-In-Jar. ↵Sven Gothel2011-11-291-5/+5
| | | | | | | | Add unit test. Misc.: - IOUtil: Add toURL* methods - TempJarCache: Add 'URL getResource(String)'
* TempJarCache/JNILibLoaderBase: Validate the to be loader JarFile's ↵Sven Gothel2011-09-231-3/+18
| | | | Certificates if caller has any. Add Convenient JNILibLoaderBase.addNativeJarLibs(..) method.
* Temp Cache: More control over the lifecycle, explicit TempJarCache ↵Sven Gothel2011-09-201-2/+26
| | | | initialization/usage only
* Enhancements / New utils: JarUtil, TempFileCache and TempJarCacheSven Gothel2011-09-191-0/+218
JarUtil: Utility to handle Jar files and it's content, incl. extracting it's entries TempFileCache: Utility to have a save temporary file cache per JVM and per instance, eg. per ClassLoader. The temp cache is cleaned up with the next usage of TempFileCache, which solves the troubles of JVM bugs and situations where the JVM is not able to close and delete open temp files. TempJarCache: Utility to cache Jar files temporary (using TempFileCache) and access it's content. This class is suitable to implement a URLClassLoader or similar resource loading facilities. All tested w/ TestTempJarCache