diff options
author | Sven Gothel <[email protected]> | 2011-12-01 20:18:27 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-12-01 20:18:27 +0100 |
commit | 2e80e7e60a48d3121feb20a237df304b2bf834d4 (patch) | |
tree | 6f3940e0207821aa3cf39505c2d719b06d7f6ac6 /src/junit/com/jogamp | |
parent | 50084db95e9dfc842a64f11db6ce8014a54b2057 (diff) |
TempJarCache/JNILibLoaderBase: Identify the Jar files by their URL within our lifecycle. JarFile's hash almost always differs.
Diffstat (limited to 'src/junit/com/jogamp')
-rw-r--r-- | src/junit/com/jogamp/common/util/TestJarUtil.java | 4 | ||||
-rw-r--r-- | src/junit/com/jogamp/common/util/TestTempJarCache.java | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/junit/com/jogamp/common/util/TestJarUtil.java b/src/junit/com/jogamp/common/util/TestJarUtil.java index fd3b93e..9eef97d 100644 --- a/src/junit/com/jogamp/common/util/TestJarUtil.java +++ b/src/junit/com/jogamp/common/util/TestJarUtil.java @@ -130,7 +130,7 @@ public class TestJarUtil { final ClassLoader rootCL = this.getClass().getClassLoader(); // Get containing JAR file "TestJarsInJar.jar" and add it to the TempJarCache - TempJarCache.addAll(GlueGenVersion.class, JarUtil.getJarFile("ClassInJar0", rootCL)); + TempJarCache.addAll(GlueGenVersion.class, JarUtil.getJarFileURL("ClassInJar0", rootCL), rootCL); // Fetch and load the contained "ClassInJar1.jar" final URL ClassInJar1_jarFileURL = JarUtil.getJarFileURL(TempJarCache.getResource("ClassInJar1.jar")); @@ -151,7 +151,7 @@ public class TestJarUtil { final ClassLoader rootCL = this.getClass().getClassLoader(); // Get containing JAR file "TestJarsInJar.jar" and add it to the TempJarCache - TempJarCache.addAll(GlueGenVersion.class, JarUtil.getJarFile("ClassInJar0", rootCL)); + TempJarCache.addAll(GlueGenVersion.class, JarUtil.getJarFileURL("ClassInJar0", rootCL), rootCL); // Fetch and load the contained "ClassInJar1.jar" final URL ClassInJar2_jarFileURL = JarUtil.getJarFileURL(TempJarCache.getResource("sub/ClassInJar2.jar")); diff --git a/src/junit/com/jogamp/common/util/TestTempJarCache.java b/src/junit/com/jogamp/common/util/TestTempJarCache.java index 199d0aa..f1630d4 100644 --- a/src/junit/com/jogamp/common/util/TestTempJarCache.java +++ b/src/junit/com/jogamp/common/util/TestTempJarCache.java @@ -161,8 +161,9 @@ public class TestTempJarCache { Assert.assertTrue(TempJarCache.initSingleton()); Assert.assertTrue(TempCacheReg.isTempJarCacheUsed()); Assert.assertTrue(TempJarCache.isInitialized()); - - TempJarCache.addAll(GlueGenVersion.class, JarUtil.getJarFile(GlueGenVersion.class.getName(), getClass().getClassLoader())); + + final ClassLoader cl = getClass().getClassLoader(); + TempJarCache.addAll(GlueGenVersion.class, JarUtil.getJarFileURL(GlueGenVersion.class.getName(), cl), cl); File f0 = new File(TempJarCache.getTempFileCache().getTempDir(), "META-INF/MANIFEST.MF"); Assert.assertTrue(f0.exists()); @@ -189,9 +190,8 @@ public class TestTempJarCache { jarUrlRoot = JarUtil.getURLDirname(jarUrlRoot); URL nativeJarURL = JarUtil.getJarFileURL(jarUrlRoot, nativeJarName); - JarFile nativeJar = JarUtil.getJarFile(nativeJarURL, cl); - TempJarCache.addNativeLibs(TempJarCache.class, nativeJar); + TempJarCache.addNativeLibs(TempJarCache.class, nativeJarURL, cl); String libFullPath = TempJarCache.findLibrary(libBaseName); Assert.assertNotNull(libFullPath); Assert.assertEquals(libBaseName, NativeLibrary.isValidNativeLibraryName(libFullPath, true)); |