From b2116c64af9f881eddfc7aab95e602e765e91fc0 Mon Sep 17 00:00:00 2001 From: nik Date: Thu, 21 May 2015 12:22:56 +0300 Subject: [PATCH] fixed tests on Mac: mark as allowed paths from JDK located not under JDK home (accessible via symlink) --- .../importing/GradleImportingTestCase.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java index 9f4e34cf2eb7..e3450b4d258b 100644 --- a/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java +++ b/plugins/gradle/testSources/org/jetbrains/plugins/gradle/importing/GradleImportingTestCase.java @@ -36,6 +36,7 @@ import com.intellij.openapi.vfs.LocalFileSystem; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.testFramework.IdeaTestUtil; import com.intellij.util.PathUtil; +import com.intellij.util.Processor; import com.intellij.util.containers.ContainerUtil; import org.gradle.util.GradleVersion; import org.gradle.wrapper.GradleWrapperMain; @@ -129,8 +130,22 @@ public abstract class GradleImportingTestCase extends ExternalSystemImportingTes } @Override - protected void collectAllowedRoots(List roots) throws IOException { + protected void collectAllowedRoots(final List roots) throws IOException { roots.add(myJdkHome); + FileUtil.processFilesRecursively(new File(myJdkHome), new Processor() { + @Override + public boolean process(File file) { + try { + String path = file.getCanonicalPath(); + if (!FileUtil.isAncestor(myJdkHome, path, false)) { + roots.add(path); + } + } + catch (IOException ignore) { } + return true; + } + }); + roots.add(PathManager.getOptionsPath()); }