From 2e80e7e60a48d3121feb20a237df304b2bf834d4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 1 Dec 2011 20:18:27 +0100 Subject: TempJarCache/JNILibLoaderBase: Identify the Jar files by their URL within our lifecycle. JarFile's hash almost always differs. --- src/junit/com/jogamp/common/util/TestTempJarCache.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/junit/com/jogamp/common/util/TestTempJarCache.java') 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)); -- cgit v1.2.3