From 5055308064a3f44e711ccb741c5f366622e536d5 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Fri, 30 Nov 2018 20:04:29 +0300 Subject: [PATCH] Rewrite AbstractNavigateToLibraryTest with light fixture tests --- .../kotlin/generators/tests/GenerateTests.kt | 6 +- .../generators/tests/GenerateTests.kt.as31 | 6 +- .../generators/tests/GenerateTests.kt.as32 | 6 +- .../generators/tests/GenerateTests.kt.as33 | 6 +- .../generators/tests/GenerateTests.kt.as34 | 6 +- .../AbstractNavigateToLibraryTest.kt | 56 ++--- .../NavigateToLibrarySourceTestGenerated.java | 223 ++++++------------ ...ateToLibrarySourceTestWithJSGenerated.java | 106 +++++++++ 8 files changed, 225 insertions(+), 190 deletions(-) create mode 100644 idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestWithJSGenerated.java diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 434bba077ac..093addad024 100755 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -80,6 +80,7 @@ import org.jetbrains.kotlin.idea.debugger.evaluate.* import org.jetbrains.kotlin.idea.debugger.sequence.exec.AbstractSequenceTraceTestCase import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest +import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractClsStubBuilderTest import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractLoadJavaClsStubTest import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextFromJsMetadataTest @@ -248,7 +249,10 @@ fun main(args: Array) { testClass { model("decompiler/navigation/usercode") - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule", testMethod = "doWithJSModuleTest") + } + + testClass { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") } testClass { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 index 89d157cdfe9..4d8594ed9dc 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as31 @@ -82,6 +82,7 @@ import org.jetbrains.kotlin.idea.debugger.AbstractSmartStepIntoTest import org.jetbrains.kotlin.idea.debugger.evaluate.* import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest +import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractClsStubBuilderTest import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractLoadJavaClsStubTest import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextFromJsMetadataTest @@ -242,7 +243,10 @@ fun main(args: Array) { testClass { model("decompiler/navigation/usercode") - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule", testMethod = "doWithJSModuleTest") + } + + testClass { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") } testClass { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 index 89d157cdfe9..4d8594ed9dc 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as32 @@ -82,6 +82,7 @@ import org.jetbrains.kotlin.idea.debugger.AbstractSmartStepIntoTest import org.jetbrains.kotlin.idea.debugger.evaluate.* import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest +import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractClsStubBuilderTest import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractLoadJavaClsStubTest import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextFromJsMetadataTest @@ -242,7 +243,10 @@ fun main(args: Array) { testClass { model("decompiler/navigation/usercode") - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule", testMethod = "doWithJSModuleTest") + } + + testClass { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") } testClass { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 index 67aa767299f..38b7d7a3c78 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as33 @@ -74,6 +74,7 @@ import org.jetbrains.kotlin.idea.debugger.AbstractSmartStepIntoTest import org.jetbrains.kotlin.idea.debugger.evaluate.* import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest +import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractClsStubBuilderTest import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractLoadJavaClsStubTest import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextFromJsMetadataTest @@ -234,7 +235,10 @@ fun main(args: Array) { testClass { model("decompiler/navigation/usercode") - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule", testMethod = "doWithJSModuleTest") + } + + testClass { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") } testClass { diff --git a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 index 67aa767299f..38b7d7a3c78 100644 --- a/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 +++ b/generators/tests/org/jetbrains/kotlin/generators/tests/GenerateTests.kt.as34 @@ -74,6 +74,7 @@ import org.jetbrains.kotlin.idea.debugger.AbstractSmartStepIntoTest import org.jetbrains.kotlin.idea.debugger.evaluate.* import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToDecompiledLibraryTest import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTest +import org.jetbrains.kotlin.idea.decompiler.navigation.AbstractNavigateToLibrarySourceTestWithJS import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractClsStubBuilderTest import org.jetbrains.kotlin.idea.decompiler.stubBuilder.AbstractLoadJavaClsStubTest import org.jetbrains.kotlin.idea.decompiler.textBuilder.AbstractCommonDecompiledTextFromJsMetadataTest @@ -234,7 +235,10 @@ fun main(args: Array) { testClass { model("decompiler/navigation/usercode") - model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule", testMethod = "doWithJSModuleTest") + } + + testClass { + model("decompiler/navigation/usercode", testClassName ="UsercodeWithJSModule") } testClass { diff --git a/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/AbstractNavigateToLibraryTest.kt b/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/AbstractNavigateToLibraryTest.kt index 666043e2623..542f1074bbf 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/AbstractNavigateToLibraryTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/AbstractNavigateToLibraryTest.kt @@ -28,26 +28,11 @@ import org.jetbrains.kotlin.test.KotlinTestUtils import java.io.File import java.util.* -abstract class AbstractNavigateToLibraryTest : KotlinCodeInsightTestCase() { - - protected fun doTest(path: String): Unit = doTestEx(path) - - protected fun doWithJSModuleTest(path: String): Unit = doTestEx(path) { - val jsModule = this.createModule("js-module") - jsModule.configureAs(ModuleKind.KOTLIN_JAVASCRIPT) - } - - abstract val withSource: Boolean +abstract class AbstractNavigateToLibraryTest : KotlinLightCodeInsightFixtureTestCase() { abstract val expectedFileExt: String - protected fun doTestEx(path: String, additionalConfig: (() -> Unit)? = null) { - module.configureAs(getProjectDescriptor()) - - if (additionalConfig != null) { - additionalConfig() - } - - configureByFile(path) + protected fun doTest(path: String) { + myFixture.configureByFile(path) NavigationChecker.checkAnnotatedCode(file, File(path.replace(".kt", expectedFileExt))) } @@ -57,24 +42,39 @@ abstract class AbstractNavigateToLibraryTest : KotlinCodeInsightTestCase() { } override fun getTestDataPath(): String = - KotlinTestUtils.getHomeDirectory() + File.separator - - - open fun getProjectDescriptor(): KotlinLightProjectDescriptor = - SdkAndMockLibraryProjectDescriptor( - PluginTestCaseBase.getTestDataPathBase() + "/decompiler/navigation/library", - withSource - ) + KotlinTestUtils.getHomeDirectory() + File.separator } abstract class AbstractNavigateToDecompiledLibraryTest : AbstractNavigateToLibraryTest() { - override val withSource: Boolean get() = false override val expectedFileExt: String get() = ".decompiled.expected" + + override fun getProjectDescriptor(): KotlinLightProjectDescriptor = PROJECT_DESCRIPTOR + + companion object { + private val PROJECT_DESCRIPTOR = SdkAndMockLibraryProjectDescriptor( + PluginTestCaseBase.getTestDataPathBase() + "/decompiler/navigation/library", false + ) + } } abstract class AbstractNavigateToLibrarySourceTest : AbstractNavigateToLibraryTest() { - override val withSource: Boolean get() = true override val expectedFileExt: String get() = ".source.expected" + + override fun getProjectDescriptor(): KotlinLightProjectDescriptor = PROJECT_DESCRIPTOR + + protected companion object { + val PROJECT_DESCRIPTOR = SdkAndMockLibraryProjectDescriptor( + PluginTestCaseBase.getTestDataPathBase() + "/decompiler/navigation/library", true + ) + } +} + +abstract class AbstractNavigateToLibrarySourceTestWithJS : AbstractNavigateToLibrarySourceTest() { + override fun getProjectDescriptor(): KotlinLightProjectDescriptor = KotlinMultiModuleProjectDescriptor( + "AbstractNavigateToLibrarySourceTestWithJS", + AbstractNavigateToLibrarySourceTest.PROJECT_DESCRIPTOR, + KotlinStdJSProjectDescriptor + ) } class NavigationChecker(val file: PsiFile, val referenceTargetChecker: (PsiElement) -> Unit) { diff --git a/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestGenerated.java index 3c8e3224a98..1c41401b458 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestGenerated.java @@ -17,181 +17,90 @@ import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") +@TestMetadata("idea/testData/decompiler/navigation/usercode") +@TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public class NavigateToLibrarySourceTestGenerated extends AbstractNavigateToLibrarySourceTest { - @TestMetadata("idea/testData/decompiler/navigation/usercode") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Usercode extends AbstractNavigateToLibrarySourceTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); - } - - public void testAllFilesPresentInUsercode() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/decompiler/navigation/usercode"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); - } - - @TestMetadata("ClassObject.kt") - public void testClassObject() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/ClassObject.kt"); - } - - @TestMetadata("Constructor.kt") - public void testConstructor() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/Constructor.kt"); - } - - @TestMetadata("Enum.kt") - public void testEnum() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/Enum.kt"); - } - - @TestMetadata("ExtensionFunction.kt") - public void testExtensionFunction() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/ExtensionFunction.kt"); - } - - @TestMetadata("ExtensionProperty.kt") - public void testExtensionProperty() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/ExtensionProperty.kt"); - } - - @TestMetadata("GenericFunctionWithExplicitlyDeclaredTypeArguments.kt") - public void testGenericFunctionWithExplicitlyDeclaredTypeArguments() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithExplicitlyDeclaredTypeArguments.kt"); - } - - @TestMetadata("GenericFunctionWithInferredTypeArguments.kt") - public void testGenericFunctionWithInferredTypeArguments() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithInferredTypeArguments.kt"); - } - - @TestMetadata("GlobalFunction.kt") - public void testGlobalFunction() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GlobalFunction.kt"); - } - - @TestMetadata("GlobalProperty.kt") - public void testGlobalProperty() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GlobalProperty.kt"); - } - - @TestMetadata("NamedObject.kt") - public void testNamedObject() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/NamedObject.kt"); - } - - @TestMetadata("OverloadedFunWithTypeParam.kt") - public void testOverloadedFunWithTypeParam() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/OverloadedFunWithTypeParam.kt"); - } - - @TestMetadata("Property.kt") - public void testProperty() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/Property.kt"); - } - - @TestMetadata("SameNameInDifferentSources.kt") - public void testSameNameInDifferentSources() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/SameNameInDifferentSources.kt"); - } - - @TestMetadata("TypeAlias.kt") - public void testTypeAlias() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/TypeAlias.kt"); - } - - @TestMetadata("TypeWithSameShortName.kt") - public void testTypeWithSameShortName() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/TypeWithSameShortName.kt"); - } + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); } - @TestMetadata("idea/testData/decompiler/navigation/usercode") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class UsercodeWithJSModule extends AbstractNavigateToLibrarySourceTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doWithJSModuleTest, TargetBackend.ANY, testDataFilePath); - } + public void testAllFilesPresentInUsercode() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/decompiler/navigation/usercode"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } - public void testAllFilesPresentInUsercodeWithJSModule() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/decompiler/navigation/usercode"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); - } + @TestMetadata("ClassObject.kt") + public void testClassObject() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/ClassObject.kt"); + } - @TestMetadata("ClassObject.kt") - public void testClassObject() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/ClassObject.kt"); - } + @TestMetadata("Constructor.kt") + public void testConstructor() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/Constructor.kt"); + } - @TestMetadata("Constructor.kt") - public void testConstructor() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/Constructor.kt"); - } + @TestMetadata("Enum.kt") + public void testEnum() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/Enum.kt"); + } - @TestMetadata("Enum.kt") - public void testEnum() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/Enum.kt"); - } + @TestMetadata("ExtensionFunction.kt") + public void testExtensionFunction() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/ExtensionFunction.kt"); + } - @TestMetadata("ExtensionFunction.kt") - public void testExtensionFunction() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/ExtensionFunction.kt"); - } + @TestMetadata("ExtensionProperty.kt") + public void testExtensionProperty() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/ExtensionProperty.kt"); + } - @TestMetadata("ExtensionProperty.kt") - public void testExtensionProperty() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/ExtensionProperty.kt"); - } + @TestMetadata("GenericFunctionWithExplicitlyDeclaredTypeArguments.kt") + public void testGenericFunctionWithExplicitlyDeclaredTypeArguments() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithExplicitlyDeclaredTypeArguments.kt"); + } - @TestMetadata("GenericFunctionWithExplicitlyDeclaredTypeArguments.kt") - public void testGenericFunctionWithExplicitlyDeclaredTypeArguments() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithExplicitlyDeclaredTypeArguments.kt"); - } + @TestMetadata("GenericFunctionWithInferredTypeArguments.kt") + public void testGenericFunctionWithInferredTypeArguments() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithInferredTypeArguments.kt"); + } - @TestMetadata("GenericFunctionWithInferredTypeArguments.kt") - public void testGenericFunctionWithInferredTypeArguments() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithInferredTypeArguments.kt"); - } + @TestMetadata("GlobalFunction.kt") + public void testGlobalFunction() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GlobalFunction.kt"); + } - @TestMetadata("GlobalFunction.kt") - public void testGlobalFunction() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GlobalFunction.kt"); - } + @TestMetadata("GlobalProperty.kt") + public void testGlobalProperty() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GlobalProperty.kt"); + } - @TestMetadata("GlobalProperty.kt") - public void testGlobalProperty() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/GlobalProperty.kt"); - } + @TestMetadata("NamedObject.kt") + public void testNamedObject() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/NamedObject.kt"); + } - @TestMetadata("NamedObject.kt") - public void testNamedObject() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/NamedObject.kt"); - } + @TestMetadata("OverloadedFunWithTypeParam.kt") + public void testOverloadedFunWithTypeParam() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/OverloadedFunWithTypeParam.kt"); + } - @TestMetadata("OverloadedFunWithTypeParam.kt") - public void testOverloadedFunWithTypeParam() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/OverloadedFunWithTypeParam.kt"); - } + @TestMetadata("Property.kt") + public void testProperty() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/Property.kt"); + } - @TestMetadata("Property.kt") - public void testProperty() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/Property.kt"); - } + @TestMetadata("SameNameInDifferentSources.kt") + public void testSameNameInDifferentSources() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/SameNameInDifferentSources.kt"); + } - @TestMetadata("SameNameInDifferentSources.kt") - public void testSameNameInDifferentSources() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/SameNameInDifferentSources.kt"); - } + @TestMetadata("TypeAlias.kt") + public void testTypeAlias() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/TypeAlias.kt"); + } - @TestMetadata("TypeAlias.kt") - public void testTypeAlias() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/TypeAlias.kt"); - } - - @TestMetadata("TypeWithSameShortName.kt") - public void testTypeWithSameShortName() throws Exception { - runTest("idea/testData/decompiler/navigation/usercode/TypeWithSameShortName.kt"); - } + @TestMetadata("TypeWithSameShortName.kt") + public void testTypeWithSameShortName() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/TypeWithSameShortName.kt"); } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestWithJSGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestWithJSGenerated.java new file mode 100644 index 00000000000..562468354b8 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/decompiler/navigation/NavigateToLibrarySourceTestWithJSGenerated.java @@ -0,0 +1,106 @@ +/* + * Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.decompiler.navigation; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.KotlinTestUtils; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/testData/decompiler/navigation/usercode") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class NavigateToLibrarySourceTestWithJSGenerated extends AbstractNavigateToLibrarySourceTestWithJS { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath); + } + + public void testAllFilesPresentInUsercodeWithJSModule() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/decompiler/navigation/usercode"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); + } + + @TestMetadata("ClassObject.kt") + public void testClassObject() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/ClassObject.kt"); + } + + @TestMetadata("Constructor.kt") + public void testConstructor() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/Constructor.kt"); + } + + @TestMetadata("Enum.kt") + public void testEnum() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/Enum.kt"); + } + + @TestMetadata("ExtensionFunction.kt") + public void testExtensionFunction() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/ExtensionFunction.kt"); + } + + @TestMetadata("ExtensionProperty.kt") + public void testExtensionProperty() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/ExtensionProperty.kt"); + } + + @TestMetadata("GenericFunctionWithExplicitlyDeclaredTypeArguments.kt") + public void testGenericFunctionWithExplicitlyDeclaredTypeArguments() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithExplicitlyDeclaredTypeArguments.kt"); + } + + @TestMetadata("GenericFunctionWithInferredTypeArguments.kt") + public void testGenericFunctionWithInferredTypeArguments() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GenericFunctionWithInferredTypeArguments.kt"); + } + + @TestMetadata("GlobalFunction.kt") + public void testGlobalFunction() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GlobalFunction.kt"); + } + + @TestMetadata("GlobalProperty.kt") + public void testGlobalProperty() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/GlobalProperty.kt"); + } + + @TestMetadata("NamedObject.kt") + public void testNamedObject() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/NamedObject.kt"); + } + + @TestMetadata("OverloadedFunWithTypeParam.kt") + public void testOverloadedFunWithTypeParam() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/OverloadedFunWithTypeParam.kt"); + } + + @TestMetadata("Property.kt") + public void testProperty() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/Property.kt"); + } + + @TestMetadata("SameNameInDifferentSources.kt") + public void testSameNameInDifferentSources() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/SameNameInDifferentSources.kt"); + } + + @TestMetadata("TypeAlias.kt") + public void testTypeAlias() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/TypeAlias.kt"); + } + + @TestMetadata("TypeWithSameShortName.kt") + public void testTypeWithSameShortName() throws Exception { + runTest("idea/testData/decompiler/navigation/usercode/TypeWithSameShortName.kt"); + } +}