Test fixed (rt.jar on Apple JRE, again)

This commit is contained in:
Roman Shevchenko
2014-04-16 13:42:47 +02:00
parent 4306f24da6
commit 439f50da53
@@ -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;
}