From 439f50da53b0c900e5d420fe54a4ba46afc795a2 Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Wed, 16 Apr 2014 13:42:13 +0200 Subject: [PATCH] Test fixed (rt.jar on Apple JRE, again) --- .../intellij/openapi/vfs/local/JarFileSystemTest.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java index a9eeae6b2b29..250a8ff5066b 100644 --- a/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java +++ b/platform/platform-tests/testSrc/com/intellij/openapi/vfs/local/JarFileSystemTest.java @@ -19,6 +19,7 @@ import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ex.PathManagerEx; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.SystemInfo; +import com.intellij.openapi.util.io.FileUtil; import com.intellij.openapi.util.io.IoTestUtil; import com.intellij.openapi.vfs.JarFileSystem; import com.intellij.openapi.vfs.LocalFileSystem; @@ -65,9 +66,7 @@ public class JarFileSystemTest extends PlatformLangTestCase { VirtualFile metaInf = jarRoot.findChild("META-INF"); assertNotNull(metaInf); - VirtualFile[] children = metaInf.getChildren(); - assertEquals(1, children.length); - assertEquals("MANIFEST.MF", children[0].getName()); + assertNotNull(metaInf.findChild("MANIFEST.MF")); } public void testJarRefresh() throws IOException { @@ -133,12 +132,14 @@ public class JarFileSystemTest extends PlatformLangTestCase { private static String getRtJarPath() { String home = System.getProperty("java.home"); - return home + (SystemInfo.isAppleJvm ? "../Classes/classes.jar" : "/lib/rt.jar"); + return home + (SystemInfo.isAppleJvm ? "/../Classes/classes.jar" : "/lib/rt.jar"); } private static VirtualFile findByPath(String path) { VirtualFile file = JarFileSystem.getInstance().findFileByPath(path); assertNotNull(file); + int p = path.indexOf(JarFileSystem.JAR_SEPARATOR); + path = FileUtil.toCanonicalPath(path.substring(0, p)) + path.substring(p); assertPathsEqual(path, file.getPath()); return file; }