mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-22 14:31:25 +07:00
welcome mock jdk 9 (IDEA-168823)
This commit is contained in:
@@ -3,6 +3,6 @@ import java.lang.invoke.*;
|
||||
public class Main {
|
||||
void foo() throws Throwable {
|
||||
MethodHandles.Lookup lookup = MethodHandles.lookup();
|
||||
lookup.findStaticVarHandle(Test.class, "psf1");
|
||||
lookup.findStaticVarHandle(Test.class, "psf1", char.class);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,6 @@ import java.lang.invoke.*;
|
||||
public class Main {
|
||||
void foo() throws Throwable {
|
||||
MethodHandles.Lookup lookup = MethodHandles.lookup();
|
||||
lookup.findVarHandle(Test.class, "f1");
|
||||
lookup.findVarHandle(Test.class, "f1", int.class);
|
||||
}
|
||||
}
|
||||
@@ -240,6 +240,6 @@ public class RegExpHighlightingTest extends LightCodeInsightFixtureTestCase {
|
||||
@NotNull
|
||||
@Override
|
||||
protected LightProjectDescriptor getProjectDescriptor() {
|
||||
return JAVA_9;
|
||||
return JAVA_8;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,18 @@
|
||||
package com.intellij.codeInsight.completion
|
||||
|
||||
import com.intellij.JavaTestUtil
|
||||
import com.intellij.testFramework.LightProjectDescriptor
|
||||
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase
|
||||
|
||||
/**
|
||||
* @author Pavel Dolgov
|
||||
*/
|
||||
class JavaLangInvokeHandleCompletionTest : LightFixtureCompletionTestCase() {
|
||||
|
||||
override fun getProjectDescriptor(): LightProjectDescriptor {
|
||||
return LightCodeInsightFixtureTestCase.JAVA_9
|
||||
}
|
||||
|
||||
fun testVirtual() = doTestFirst(1, "m1", "pm1", "m2")
|
||||
fun testVirtualPrefixed() = doTest(1, "m1", "m2", "pm1")
|
||||
|
||||
@@ -33,9 +39,8 @@ class JavaLangInvokeHandleCompletionTest : LightFixtureCompletionTestCase() {
|
||||
fun testStaticGetter() = doTest(0, "psf1", "sf1", "sf2")
|
||||
fun testStaticSetter() = doTest(2, "psf1", "sf1", "sf2")
|
||||
|
||||
// TODO enable when the mock for jdk9 is available
|
||||
fun _testVarHandle() = doTest(0, "f1", "pf1", "f2")
|
||||
fun _testStaticVarHandle() = doTest(0, "psf1", "sf1", "sf2")
|
||||
fun testVarHandle() = doTest(0, "f1", "pf1", "f2")
|
||||
fun testStaticVarHandle() = doTest(0, "psf1", "sf1", "sf2")
|
||||
|
||||
override fun getBasePath(): String {
|
||||
return JavaTestUtil.getRelativeJavaTestDataPath() + "/codeInsight/completion/invokeHandle/"
|
||||
|
||||
BIN
java/mockJDK-1.9/jre/lib/annotations.jar
Normal file
BIN
java/mockJDK-1.9/jre/lib/annotations.jar
Normal file
Binary file not shown.
BIN
java/mockJDK-1.9/jre/lib/rt.jar
Normal file
BIN
java/mockJDK-1.9/jre/lib/rt.jar
Normal file
Binary file not shown.
@@ -99,6 +99,11 @@ public class IdeaTestUtil extends PlatformTestUtil {
|
||||
return createMockJdk("java 1.8", getMockJdk18Path().getPath());
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public static Sdk getMockJdk9() {
|
||||
return createMockJdk("java 9", getMockJdk9Path().getPath());
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public static Sdk getMockJdk14() {
|
||||
return createMockJdk("java 1.4", getMockJdk14Path().getPath());
|
||||
@@ -116,6 +121,10 @@ public class IdeaTestUtil extends PlatformTestUtil {
|
||||
return getPathForJdkNamed(MOCK_JDK_DIR_NAME_PREFIX + "1.8");
|
||||
}
|
||||
|
||||
public static File getMockJdk9Path() {
|
||||
return getPathForJdkNamed(MOCK_JDK_DIR_NAME_PREFIX + "1.9");
|
||||
}
|
||||
|
||||
public static String getMockJdkVersion(String path) {
|
||||
String name = PathUtil.getFileName(path);
|
||||
if (name.startsWith(MOCK_JDK_DIR_NAME_PREFIX)) {
|
||||
|
||||
@@ -79,7 +79,7 @@ public abstract class LightCodeInsightFixtureTestCase extends UsefulTestCase {
|
||||
public static final LightProjectDescriptor JAVA_9 = new DefaultLightProjectDescriptor() {
|
||||
@Override
|
||||
public Sdk getSdk() {
|
||||
return IdeaTestUtil.getMockJdk18();
|
||||
return IdeaTestUtil.getMockJdk9();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user