fixed tests on Mac: mark as allowed paths from JDK located not under JDK home (accessible via symlink)

This commit is contained in:
nik
2015-05-21 12:23:17 +03:00
parent b26d6969f8
commit b2116c64af
@@ -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<String> roots) throws IOException {
protected void collectAllowedRoots(final List<String> roots) throws IOException {
roots.add(myJdkHome);
FileUtil.processFilesRecursively(new File(myJdkHome), new Processor<File>() {
@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());
}