Run psi check on light classes from compiled Kotlin
This commit is contained in:
@@ -9,7 +9,4 @@ public interface Generic <N, NN> {
|
||||
|
||||
@org.jetbrains.annotations.Nullable
|
||||
NN b1(@org.jetbrains.annotations.Nullable NN nn);
|
||||
|
||||
final class DefaultImpls {
|
||||
}
|
||||
}
|
||||
+1
-4
@@ -1,5 +1,5 @@
|
||||
public interface Primitives {
|
||||
int $$int /* Real name is 'int' */(int x);
|
||||
int $$int /* Real name is 'int' */(int i);
|
||||
|
||||
@org.jetbrains.annotations.Nullable
|
||||
java.lang.Boolean getNullableBool();
|
||||
@@ -40,7 +40,4 @@ public interface Primitives {
|
||||
float getFloat();
|
||||
|
||||
double getDouble();
|
||||
|
||||
final class DefaultImpls {
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Primitives
|
||||
|
||||
interface Primitives {
|
||||
fun int(x: Int): Int
|
||||
fun int(i: Int): Int
|
||||
|
||||
val nullableBool: Boolean?
|
||||
val nullableByte: Byte?
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// PrivateInClass
|
||||
|
||||
class PrivateInClass private (g: String?) {
|
||||
class PrivateInClass private constructor (g: String?) {
|
||||
private var nn: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
public interface Trait {
|
||||
@org.jetbrains.annotations.NotNull
|
||||
java.lang.String notNull(@org.jetbrains.annotations.NotNull java.lang.String a);
|
||||
java.lang.String notNull(@org.jetbrains.annotations.NotNull java.lang.String p);
|
||||
|
||||
@org.jetbrains.annotations.Nullable
|
||||
java.lang.String nullable(@org.jetbrains.annotations.Nullable java.lang.String a);
|
||||
java.lang.String nullable(@org.jetbrains.annotations.Nullable java.lang.String p);
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
java.lang.String notNullWithNN();
|
||||
@@ -34,7 +34,4 @@ public interface Trait {
|
||||
java.lang.String getNotNullVar();
|
||||
|
||||
void setNotNullVar(@org.jetbrains.annotations.NotNull java.lang.String p);
|
||||
|
||||
final class DefaultImpls {
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import org.jetbrains.annotations.NotNull
|
||||
import org.jetbrains.annotations.Nullable
|
||||
|
||||
interface Trait {
|
||||
fun notNull(a: String): String
|
||||
fun nullable(a: String?): String?
|
||||
fun notNull(p: String): String
|
||||
fun nullable(p: String?): String?
|
||||
|
||||
@NotNull fun notNullWithNN(): String
|
||||
@Nullable fun notNullWithN(): String
|
||||
|
||||
-3
@@ -22,7 +22,4 @@ public interface TraitClassObjectField {
|
||||
|
||||
private Companion() { /* compiled code */ }
|
||||
}
|
||||
|
||||
final class DefaultImpls {
|
||||
}
|
||||
}
|
||||
@@ -72,6 +72,11 @@ public abstract class AbstractCompilerLightClassTest extends KotlinMultiFileTest
|
||||
throw ExceptionUtilsKt.rethrow(e);
|
||||
}
|
||||
}
|
||||
}, new Function1<String, String>() {
|
||||
@Override
|
||||
public String invoke(String s) {
|
||||
return LightClassTestCommon.INSTANCE.removeEmptyDefaultImpls(s);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("annotationClass.kt")
|
||||
@TestMetadata("AnnotationClass.kt")
|
||||
public void testAnnotationClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/annotationClass.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/AnnotationClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -61,9 +61,9 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("WithPlatformTypes.kt")
|
||||
public void testWithPlatformTypes() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/delegation/WithPlatformTypes.kt");
|
||||
@TestMetadata("WithPlatformTypes.NoCompile.kt")
|
||||
public void testWithPlatformTypes_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/delegation/WithPlatformTypes.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
@@ -76,9 +76,9 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/facades"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("EmptyFile.kt")
|
||||
public void testEmptyFile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/facades/EmptyFile.kt");
|
||||
@TestMetadata("EmptyFile.NoCompile.kt")
|
||||
public void testEmptyFile_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/facades/EmptyFile.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -181,9 +181,9 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateInTrait.kt")
|
||||
public void testPrivateInTrait() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/PrivateInTrait.kt");
|
||||
@TestMetadata("PrivateInTrait.NoCompile.kt")
|
||||
public void testPrivateInTrait_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/PrivateInTrait.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -199,9 +199,9 @@ public class CompilerLightClassTestGenerated extends AbstractCompilerLightClassT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TraitClassObjectField.kt")
|
||||
public void testTraitClassObjectField() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/TraitClassObjectField.kt");
|
||||
@TestMetadata("TraitClassObjectField.NoCompile.kt")
|
||||
public void testTraitClassObjectField_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/TraitClassObjectField.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,4 +58,9 @@ object LightClassTestCommon {
|
||||
val actual = normalizeText(buffer.toString())
|
||||
return actual
|
||||
}
|
||||
|
||||
// Actual text for light class is generated with ClsElementImpl.appendMirrorText() that can find empty DefaultImpl inner class in stubs
|
||||
// for all interfaces. This inner class can't be used in Java as it generally is not seen from light classes built from Kotlin sources.
|
||||
// It is also omitted during classes generation in backend so it also absent in light classes built from compiled code.
|
||||
public fun removeEmptyDefaultImpls(text: String) : String = text.replace("\n final class DefaultImpls {\n }\n", "")
|
||||
}
|
||||
@@ -42,6 +42,7 @@ import org.jetbrains.kotlin.generators.tests.reservedWords.generateTestDataForRe
|
||||
import org.jetbrains.kotlin.idea.AbstractExpressionSelectionTest
|
||||
import org.jetbrains.kotlin.idea.AbstractSmartSelectionTest
|
||||
import org.jetbrains.kotlin.idea.actions.AbstractGotoTestOrCodeActionTest
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.AbstractIdeCompiledLightClassTest
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.AbstractIdeLightClassTest
|
||||
import org.jetbrains.kotlin.idea.codeInsight.*
|
||||
import org.jetbrains.kotlin.idea.codeInsight.generate.AbstractCodeInsightActionTest
|
||||
@@ -776,6 +777,10 @@ fun main(args: Array<String>) {
|
||||
testClass<AbstractIdeLightClassTest>() {
|
||||
model("asJava/lightClasses", excludeDirs = listOf("delegation"))
|
||||
}
|
||||
|
||||
testClass<AbstractIdeCompiledLightClassTest> {
|
||||
model("asJava/lightClasses", pattern = """^([^\.]+)\.kt$""", withTestRootMethod = true)
|
||||
}
|
||||
}
|
||||
|
||||
testGroup("idea/idea-completion/tests", "idea/idea-completion/testData") {
|
||||
@@ -1081,7 +1086,8 @@ private class TestGroup(val testsRoot: String, val testDataRoot: String) {
|
||||
testClassName: String? = null,
|
||||
targetBackend: TargetBackend = TargetBackend.ANY,
|
||||
excludeDirs: List<String> = listOf(),
|
||||
filenameStartsLowerCase: Boolean? = null
|
||||
filenameStartsLowerCase: Boolean? = null,
|
||||
withTestRootMethod: Boolean = false
|
||||
) {
|
||||
val rootFile = File(testDataRoot + "/" + relativeRootPath)
|
||||
val compiledPattern = Pattern.compile(pattern)
|
||||
@@ -1093,7 +1099,8 @@ private class TestGroup(val testsRoot: String, val testDataRoot: String) {
|
||||
}
|
||||
else {
|
||||
SimpleTestClassModel(rootFile, recursive, excludeParentDirs,
|
||||
compiledPattern, filenameStartsLowerCase, testMethod, className, targetBackend, excludeDirs, false)
|
||||
compiledPattern, filenameStartsLowerCase, testMethod, className,
|
||||
targetBackend, excludeDirs, withTestRootMethod)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -16,38 +16,79 @@
|
||||
|
||||
package org.jetbrains.kotlin.idea.caches.resolve
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.roots.ModuleRootModificationUtil
|
||||
import com.intellij.openapi.util.io.FileUtilRt
|
||||
import com.intellij.psi.JavaPsiFacade
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.asJava.LightClassTestCommon
|
||||
import org.jetbrains.kotlin.idea.KotlinDaemonAnalyzerTestCase
|
||||
import org.jetbrains.kotlin.idea.test.ConfigLibraryUtil
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.MockLibraryUtil
|
||||
import org.junit.Assert
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractIdeLightClassTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
fun doTest(testDataPath: String) {
|
||||
myFixture.configureByFile(testDataPath)
|
||||
|
||||
val project = project
|
||||
LightClassTestCommon.testLightClass(
|
||||
File(testDataPath),
|
||||
findLightClass = {
|
||||
val clazz = JavaPsiFacade.getInstance(project).findClass(it, GlobalSearchScope.allScope(project))
|
||||
if (clazz != null) {
|
||||
PsiElementChecker.checkPsiElementStructure(clazz)
|
||||
}
|
||||
clazz
|
||||
|
||||
},
|
||||
normalizeText = {
|
||||
//NOTE: ide and compiler differ in names generated for parameters with unspecified names
|
||||
it
|
||||
.replace("java.lang.String s,", "java.lang.String p,")
|
||||
.replace("java.lang.String s)", "java.lang.String p)")
|
||||
.replace("java.lang.String s1", "java.lang.String p1")
|
||||
.replace("java.lang.String s2", "java.lang.String p2")
|
||||
}
|
||||
)
|
||||
testLightClass(project, testDataPath, { LightClassTestCommon.removeEmptyDefaultImpls(it) })
|
||||
}
|
||||
|
||||
override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE
|
||||
}
|
||||
|
||||
public abstract class AbstractIdeCompiledLightClassTest : KotlinDaemonAnalyzerTestCase() {
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
|
||||
val testName = getTestName(false)
|
||||
if (testName.startsWith("AllFilesPresentIn")) return
|
||||
|
||||
val filePath = "${KotlinTestUtils.getTestsRoot(this)}/${getTestName(false)}.kt"
|
||||
|
||||
Assert.assertTrue("File doesn't exist $filePath", File(filePath).exists())
|
||||
|
||||
val libraryJar = MockLibraryUtil.compileLibraryToJar(filePath, libName(), false, false)
|
||||
val jarUrl = "jar://" + FileUtilRt.toSystemIndependentName(libraryJar.absolutePath) + "!/"
|
||||
ModuleRootModificationUtil.addModuleLibrary(module, jarUrl)
|
||||
}
|
||||
|
||||
private fun libName() = "libFor" + getTestName(false)
|
||||
|
||||
fun doTest(testDataPath: String) {
|
||||
testLightClass(project, testDataPath, { it })
|
||||
}
|
||||
}
|
||||
|
||||
private fun testLightClass(project: Project, testDataPath: String, normalize: (String) -> String) {
|
||||
LightClassTestCommon.testLightClass(
|
||||
File(testDataPath),
|
||||
findLightClass = {
|
||||
val clazz = JavaPsiFacade.getInstance(project).findClass(it, GlobalSearchScope.allScope(project))
|
||||
if (clazz != null) {
|
||||
PsiElementChecker.checkPsiElementStructure(clazz)
|
||||
}
|
||||
clazz
|
||||
|
||||
},
|
||||
normalizeText = { text ->
|
||||
//NOTE: ide and compiler differ in names generated for parameters with unspecified names
|
||||
text
|
||||
.replace("java.lang.String s,", "java.lang.String p,")
|
||||
.replace("java.lang.String s)", "java.lang.String p)")
|
||||
.replace("java.lang.String s1", "java.lang.String p1")
|
||||
.replace("java.lang.String s2", "java.lang.String p2")
|
||||
.removeLinesStartingWith("@kotlin.jvm.internal.KotlinClass")
|
||||
.removeLinesStartingWith("@kotlin.jvm.internal.KotlinFileFacade")
|
||||
.run(normalize)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun String.removeLinesStartingWith(prefix: String) : String {
|
||||
return lines().filterNot { it.trimStart().startsWith(prefix) }.joinToString(separator = "\n")
|
||||
}
|
||||
|
||||
|
||||
+262
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.caches.resolve;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
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("compiler/testData/asJava/lightClasses")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class IdeCompiledLightClassTestGenerated extends AbstractIdeCompiledLightClassTest {
|
||||
public void testAllFilesPresentInLightClasses() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("AnnotationClass.kt")
|
||||
public void testAnnotationClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/AnnotationClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
public String getTestsRoot() {
|
||||
return "compiler/testData/asJava/lightClasses";
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/delegation")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Delegation extends AbstractIdeCompiledLightClassTest {
|
||||
public void testAllFilesPresentInDelegation() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/delegation"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("Function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/delegation/Function.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Property.kt")
|
||||
public void testProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/delegation/Property.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
public String getTestsRoot() {
|
||||
return "compiler/testData/asJava/lightClasses/delegation";
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/facades")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Facades extends AbstractIdeCompiledLightClassTest {
|
||||
public void testAllFilesPresentInFacades() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/facades"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("SingleFile.kt")
|
||||
public void testSingleFile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/facades/SingleFile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("SingleJvmClassName.kt")
|
||||
public void testSingleJvmClassName() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/facades/SingleJvmClassName.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
public String getTestsRoot() {
|
||||
return "compiler/testData/asJava/lightClasses/facades";
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class NullabilityAnnotations extends AbstractIdeCompiledLightClassTest {
|
||||
public void testAllFilesPresentInNullabilityAnnotations() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/nullabilityAnnotations"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("Class.kt")
|
||||
public void testClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Class.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ClassObjectField.kt")
|
||||
public void testClassObjectField() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/ClassObjectField.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ClassWithConstructor.kt")
|
||||
public void testClassWithConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/ClassWithConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ClassWithConstructorAndProperties.kt")
|
||||
public void testClassWithConstructorAndProperties() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/ClassWithConstructorAndProperties.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("FileFacade.kt")
|
||||
public void testFileFacade() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/FileFacade.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Generic.kt")
|
||||
public void testGeneric() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Generic.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("IntOverridesAny.kt")
|
||||
public void testIntOverridesAny() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/IntOverridesAny.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("JvmOverloads.kt")
|
||||
public void testJvmOverloads() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/JvmOverloads.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NullableUnitReturn.kt")
|
||||
public void testNullableUnitReturn() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/NullableUnitReturn.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OverrideAnyWithUnit.kt")
|
||||
public void testOverrideAnyWithUnit() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/OverrideAnyWithUnit.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PlatformTypes.kt")
|
||||
public void testPlatformTypes() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/PlatformTypes.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Primitives.kt")
|
||||
public void testPrimitives() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Primitives.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateInClass.kt")
|
||||
public void testPrivateInClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/PrivateInClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Synthetic.kt")
|
||||
public void testSynthetic() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Synthetic.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Trait.kt")
|
||||
public void testTrait() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/Trait.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("UnitAsGenericArgument.kt")
|
||||
public void testUnitAsGenericArgument() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/UnitAsGenericArgument.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("UnitParameter.kt")
|
||||
public void testUnitParameter() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/UnitParameter.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("VoidReturn.kt")
|
||||
public void testVoidReturn() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/VoidReturn.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
public String getTestsRoot() {
|
||||
return "compiler/testData/asJava/lightClasses/nullabilityAnnotations";
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/object")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Object extends AbstractIdeCompiledLightClassTest {
|
||||
public void testAllFilesPresentInObject() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/object"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("SimpleObject.kt")
|
||||
public void testSimpleObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/object/SimpleObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
public String getTestsRoot() {
|
||||
return "compiler/testData/asJava/lightClasses/object";
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/asJava/lightClasses/publicField")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class PublicField extends AbstractIdeCompiledLightClassTest {
|
||||
public void testAllFilesPresentInPublicField() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/publicField"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("CompanionObject.kt")
|
||||
public void testCompanionObject() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/publicField/CompanionObject.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("Simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/publicField/Simple.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
public String getTestsRoot() {
|
||||
return "compiler/testData/asJava/lightClasses/publicField";
|
||||
}
|
||||
}
|
||||
}
|
||||
+11
-11
@@ -35,9 +35,9 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses"), Pattern.compile("^(.+)\\.kt$"), true, "delegation");
|
||||
}
|
||||
|
||||
@TestMetadata("annotationClass.kt")
|
||||
@TestMetadata("AnnotationClass.kt")
|
||||
public void testAnnotationClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/annotationClass.kt");
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/AnnotationClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/facades"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("EmptyFile.kt")
|
||||
public void testEmptyFile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/facades/EmptyFile.kt");
|
||||
@TestMetadata("EmptyFile.NoCompile.kt")
|
||||
public void testEmptyFile_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/facades/EmptyFile.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -154,9 +154,9 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PrivateInTrait.kt")
|
||||
public void testPrivateInTrait() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/PrivateInTrait.kt");
|
||||
@TestMetadata("PrivateInTrait.NoCompile.kt")
|
||||
public void testPrivateInTrait_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/PrivateInTrait.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@@ -172,9 +172,9 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TraitClassObjectField.kt")
|
||||
public void testTraitClassObjectField() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/TraitClassObjectField.kt");
|
||||
@TestMetadata("TraitClassObjectField.NoCompile.kt")
|
||||
public void testTraitClassObjectField_NoCompile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/nullabilityAnnotations/TraitClassObjectField.NoCompile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user