Copy mock JDK 9 from intellij idea
(cherry picked from commit aef9220)
This commit is contained in:
Binary file not shown.
BIN
Binary file not shown.
@@ -18,6 +18,7 @@ package org.jetbrains.kotlin.idea.test;
|
||||
|
||||
import com.intellij.openapi.projectRoots.JavaSdk;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.projectRoots.impl.JavaSdkImpl;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.newvfs.impl.VfsRootAccess;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -39,6 +40,12 @@ public class PluginTestCaseBase {
|
||||
return KotlinTestUtils.getHomeDirectory() + TEST_DATA_PROJECT_RELATIVE;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@TestOnly
|
||||
private static Sdk createMockJdk(@NotNull String name, String path) {
|
||||
return ((JavaSdkImpl)JavaSdk.getInstance()).createMockJdk(name, path, false);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static Sdk getSdk(String sdkHome, String name) {
|
||||
return JavaSdk.getInstance().createJdk(name, sdkHome, true);
|
||||
@@ -49,6 +56,12 @@ public class PluginTestCaseBase {
|
||||
return getSdk("compiler/testData/mockJDK/jre", "Mock JDK");
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@NotNull
|
||||
public static Sdk mockJdk9() {
|
||||
return createMockJdk("9", "compiler/testData/mockJDK9/jre");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Sdk fullJdk() {
|
||||
String javaHome = System.getProperty("java.home");
|
||||
|
||||
Reference in New Issue
Block a user