From a5c352dc9f43ffd88c782f3ffee74d3d850ab43c Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Thu, 20 Apr 2017 16:38:16 +0300 Subject: [PATCH] Add -Xuse-old-class-files-reading CLI argument By default we use the fast implementation in CLI compiler, but in the most of the tests the old one is enabled Also add tests on CompiledJava with the fast class reading implementation --- .../arguments/K2JVMCompilerArguments.java | 7 + .../jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt | 7 + .../compiler/KotlinCliJavaFileManagerImpl.kt | 6 +- .../cli/jvm/compiler/KotlinCoreEnvironment.kt | 4 +- .../kotlin/config/JVMConfigurationKeys.java | 3 + compiler/testData/cli/jvm/extraHelp.out | 1 + .../jvm/compiler/AbstractLoadJavaTest.java | 13 +- ...bstractLoadJavaWithFastClassReadingTest.kt | 21 + .../jvm/compiler/LoadDescriptorUtil.java | 5 +- .../AbstractJvmRuntimeDescriptorLoaderTest.kt | 2 +- .../cli/jvm/KotlinCliJavaFileManagerTest.kt | 5 +- ...JavaWithFastClassReadingTestGenerated.java | 1757 +++++++++++++++++ .../kotlin/generators/tests/GenerateTests.kt | 4 + 13 files changed, 1824 insertions(+), 11 deletions(-) create mode 100644 compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithFastClassReadingTest.kt create mode 100644 compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java index 36645f3d8b7..226a1f7a4a5 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java @@ -107,6 +107,13 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments { @Argument(value = "-Xskip-runtime-version-check", description = "Allow Kotlin runtime libraries of incompatible versions in the classpath") public boolean skipRuntimeVersionCheck; + @Argument( + value = "-Xuse-old-class-files-reading", + description = "Use old class files reading implementation " + + "(may slow down the build and should be used in case of problems with the new implementation)" + ) + public boolean useOldClassFilesReading; + @Argument( value = "-Xdump-declarations-to", valueDescription = "", diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt index 975c1b04534..90928ad328b 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/K2JVMCompiler.kt @@ -308,6 +308,13 @@ class K2JVMCompiler : CLICompiler() { configuration.put(JVMConfigurationKeys.DISABLE_OPTIMIZATION, arguments.noOptimize) configuration.put(JVMConfigurationKeys.INHERIT_MULTIFILE_PARTS, arguments.inheritMultifileParts) configuration.put(JVMConfigurationKeys.SKIP_RUNTIME_VERSION_CHECK, arguments.skipRuntimeVersionCheck) + configuration.put(JVMConfigurationKeys.USE_FAST_CLASS_FILES_READING, !arguments.useOldClassFilesReading) + + if (arguments.useOldClassFilesReading) { + configuration.getNotNull(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY) + .report(INFO, "Using the old java class files reading implementation") + } + configuration.put(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE, arguments.allowKotlinPackage) configuration.put(CLIConfigurationKeys.REPORT_PERF, arguments.reportPerf) configuration.put(JVMConfigurationKeys.USE_SINGLE_MODULE, arguments.singleModule) diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCliJavaFileManagerImpl.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCliJavaFileManagerImpl.kt index fb096f8f81b..98e5d6b9f41 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCliJavaFileManagerImpl.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCliJavaFileManagerImpl.kt @@ -47,9 +47,11 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ private var index: JvmDependenciesIndex by Delegates.notNull() private val topLevelClassesCache: MutableMap = THashMap() private val allScope = GlobalSearchScope.allScope(myPsiManager.project) + private var useFastClassFilesReading = false - fun initIndex(packagesCache: JvmDependenciesIndex) { + fun initialize(packagesCache: JvmDependenciesIndex, useFastClassFilesReading: Boolean) { this.index = packagesCache + this.useFastClassFilesReading = useFastClassFilesReading } private fun findPsiClass(classId: ClassId, searchScope: GlobalSearchScope): PsiClass? = perfCounter.time { @@ -72,7 +74,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ override fun findClass(classId: ClassId, searchScope: GlobalSearchScope): JavaClass? { val virtualFile = findVirtualFileForTopLevelClass(classId, searchScope) ?: return null - if (virtualFile.extension == "class") { + if (useFastClassFilesReading && virtualFile.extension == "class") { // We return all class files' names in the directory in knownClassNamesInPackage method, so one may request an inner class return binaryCache.getOrPut(classId) { // Note that currently we implicitly suppose that searchScope for binary classes is constant and we do not use it diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt index fe0bda1a8d9..7f2b39d2473 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/compiler/KotlinCoreEnvironment.kt @@ -209,8 +209,8 @@ class KotlinCoreEnvironment private constructor( rootsIndex = indexFactory.makeIndexFor(initialRoots) updateClasspathFromRootsIndex(rootsIndex) - (ServiceManager.getService(project, CoreJavaFileManager::class.java) - as KotlinCliJavaFileManagerImpl).initIndex(rootsIndex) + (ServiceManager.getService(project, CoreJavaFileManager::class.java) as KotlinCliJavaFileManagerImpl) + .initialize(rootsIndex, configuration.getBoolean(JVMConfigurationKeys.USE_FAST_CLASS_FILES_READING)) val finderFactory = CliVirtualFileFinderFactory(rootsIndex) project.registerService(MetadataFinderFactory::class.java, finderFactory) diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java b/compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java index f33d2d75965..81629b115a6 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/config/JVMConfigurationKeys.java @@ -107,4 +107,7 @@ public class JVMConfigurationKeys { public static final CompilerConfigurationKey IR = CompilerConfigurationKey.create("IR"); + + public static final CompilerConfigurationKey USE_FAST_CLASS_FILES_READING = + CompilerConfigurationKey.create("use fast class files reading implementation [experimental]"); } diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index a36ac403df3..4a4ecfbe2e5 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -6,6 +6,7 @@ where advanced options include: -Xreport-perf Report detailed performance statistics -Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade -Xskip-runtime-version-check Allow Kotlin runtime libraries of incompatible versions in the classpath + -Xuse-old-class-files-reading Use old class files reading implementation (may slow down the build and should be used in case of problems with the new implementation) -Xdump-declarations-to= Path to JSON file to dump Java to Kotlin declaration mappings -Xsingle-module Combine modules for source files and binary dependencies into a single module -Xadd-compiler-builtins Add definitions of built-in declarations to the compilation classpath (useful with -no-stdlib) diff --git a/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java b/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java index 16cb0d93afe..2b0f8fdabda 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java +++ b/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaTest.java @@ -123,7 +123,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { Assert.assertEquals("test", packageFromSource.getName().asString()); PackageViewDescriptor packageFromBinary = LoadDescriptorUtil.loadTestPackageAndBindingContextFromJavaRoot( - tmpdir, getTestRootDisposable(), getJdkKind(), configurationKind, true + tmpdir, getTestRootDisposable(), getJdkKind(), configurationKind, true, false ).first; for (DeclarationDescriptor descriptor : DescriptorUtils.getAllDescriptors(packageFromBinary.getMemberScope())) { @@ -138,6 +138,10 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { compareDescriptors(packageFromSource, packageFromBinary, comparatorConfiguration, txtFile); } + protected boolean useFastClassFilesReading() { + return false; + } + protected void doTestJavaAgainstKotlin(String expectedFileName) throws Exception { File expectedFile = new File(expectedFileName); File sourcesDir = new File(expectedFileName.replaceFirst("\\.txt$", "")); @@ -207,8 +211,8 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { FileUtil.copy(originalJavaFile, new File(testPackageDir, originalJavaFile.getName())); Pair javaPackageAndContext = loadTestPackageAndBindingContextFromJavaRoot( - tmpdir, getTestRootDisposable(), getJdkKind(), ConfigurationKind.JDK_ONLY, false - ); + tmpdir, getTestRootDisposable(), getJdkKind(), ConfigurationKind.JDK_ONLY, false, + false); checkJavaPackage( expectedFile, javaPackageAndContext.first, javaPackageAndContext.second, @@ -253,7 +257,8 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir { @NotNull ConfigurationKind configurationKind ) throws IOException { compileJavaWithAnnotationsJar(javaFiles, outDir); - return loadTestPackageAndBindingContextFromJavaRoot(outDir, myTestRootDisposable, getJdkKind(), configurationKind, true); + return loadTestPackageAndBindingContextFromJavaRoot(outDir, myTestRootDisposable, getJdkKind(), configurationKind, true, + useFastClassFilesReading()); } private static void checkJavaPackage( diff --git a/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithFastClassReadingTest.kt b/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithFastClassReadingTest.kt new file mode 100644 index 00000000000..f85822778cf --- /dev/null +++ b/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/AbstractLoadJavaWithFastClassReadingTest.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2010-2017 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.jvm.compiler + +abstract class AbstractLoadJavaWithFastClassReadingTest : AbstractLoadJavaTest() { + override fun useFastClassFilesReading() = true +} diff --git a/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java b/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java index 75b9e35161b..203de647d77 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java +++ b/compiler/tests-common/org/jetbrains/kotlin/jvm/compiler/LoadDescriptorUtil.java @@ -29,6 +29,7 @@ import org.jetbrains.kotlin.codegen.GenerationUtils; import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime; import org.jetbrains.kotlin.codegen.state.GenerationState; import org.jetbrains.kotlin.config.CompilerConfiguration; +import org.jetbrains.kotlin.config.JVMConfigurationKeys; import org.jetbrains.kotlin.descriptors.ModuleDescriptor; import org.jetbrains.kotlin.descriptors.PackageViewDescriptor; import org.jetbrains.kotlin.name.FqName; @@ -70,7 +71,8 @@ public class LoadDescriptorUtil { @NotNull Disposable disposable, @NotNull TestJdkKind testJdkKind, @NotNull ConfigurationKind configurationKind, - boolean isBinaryRoot + boolean isBinaryRoot, + boolean useFastClassReading ) { List javaBinaryRoots = new ArrayList<>(); javaBinaryRoots.add(KotlinTestUtils.getAnnotationsJar()); @@ -85,6 +87,7 @@ public class LoadDescriptorUtil { } CompilerConfiguration configuration = KotlinTestUtils.newConfiguration(configurationKind, testJdkKind, javaBinaryRoots, javaSourceRoots); + configuration.put(JVMConfigurationKeys.USE_FAST_CLASS_FILES_READING, useFastClassReading); KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForTests(disposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES); diff --git a/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt b/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt index 50bdb9f9133..24f6f892d49 100644 --- a/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt +++ b/compiler/tests-common/org/jetbrains/kotlin/jvm/runtime/AbstractJvmRuntimeDescriptorLoaderTest.kt @@ -107,7 +107,7 @@ abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() { } val expected = LoadDescriptorUtil.loadTestPackageAndBindingContextFromJavaRoot( - tmpdir, testRootDisposable, jdkKind, ConfigurationKind.ALL, true + tmpdir, testRootDisposable, jdkKind, ConfigurationKind.ALL, true, false ).first RecursiveDescriptorComparator.validateAndCompareDescriptors(expected, actual, comparatorConfiguration, null) diff --git a/compiler/tests/org/jetbrains/kotlin/cli/jvm/KotlinCliJavaFileManagerTest.kt b/compiler/tests/org/jetbrains/kotlin/cli/jvm/KotlinCliJavaFileManagerTest.kt index b6a1330356d..bd24d467c10 100644 --- a/compiler/tests/org/jetbrains/kotlin/cli/jvm/KotlinCliJavaFileManagerTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/cli/jvm/KotlinCliJavaFileManagerTest.kt @@ -200,7 +200,10 @@ class KotlinCliJavaFileManagerTest : KotlinTestWithEnvironment() { val coreJavaFileManager = ServiceManager.getService(project, CoreJavaFileManager::class.java) as KotlinCliJavaFileManagerImpl val root = environment.contentRootToVirtualFile(JavaSourceRoot(javaFilesDir!!, null))!! - coreJavaFileManager.initIndex(JvmDependenciesIndexImpl(listOf(JavaRoot(root, JavaRoot.RootType.SOURCE)))) + coreJavaFileManager.initialize( + JvmDependenciesIndexImpl(listOf(JavaRoot(root, JavaRoot.RootType.SOURCE))), + useFastClassFilesReading = true + ) return coreJavaFileManager } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java new file mode 100644 index 00000000000..00d42f30305 --- /dev/null +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java @@ -0,0 +1,1757 @@ +/* + * Copyright 2010-2017 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.jvm.compiler; + +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("compiler/testData/loadJava/compiledJava") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class LoadJavaWithFastClassReadingTestGenerated extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInCompiledJava() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ArrayTypeVariance.java") + public void testArrayTypeVariance() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ArrayTypeVariance.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassDoesNotOverrideMethod.java") + public void testClassDoesNotOverrideMethod() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassDoesNotOverrideMethod.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassWithConstVal.java") + public void testClassWithConstVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassWithConstVal.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassWithTypeP.java") + public void testClassWithTypeP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassWithTypeP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassWithTypePExtendsIterableP.java") + public void testClassWithTypePExtendsIterableP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassWithTypePExtendsIterableP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassWithTypePP.java") + public void testClassWithTypePP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassWithTypePP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassWithTypePRefNext.java") + public void testClassWithTypePRefNext() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassWithTypePRefNext.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassWithTypePRefSelf.java") + public void testClassWithTypePRefSelf() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassWithTypePRefSelf.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassWithTypePRefSelfAndClass.java") + public void testClassWithTypePRefSelfAndClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/ClassWithTypePRefSelfAndClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("FieldAsVar.java") + public void testFieldAsVar() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/FieldAsVar.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("FieldOfArrayType.java") + public void testFieldOfArrayType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/FieldOfArrayType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("FinalFieldAsVal.java") + public void testFinalFieldAsVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/FinalFieldAsVal.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritMethodsDifferentReturnTypes.java") + public void testInheritMethodsDifferentReturnTypes() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InheritMethodsDifferentReturnTypes.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritMethodsDifferentReturnTypesGeneric.java") + public void testInheritMethodsDifferentReturnTypesGeneric() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InheritMethodsDifferentReturnTypesGeneric.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InnerClass.java") + public void testInnerClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InnerClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InnerClassReferencesOuterTP.java") + public void testInnerClassReferencesOuterTP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InnerClassReferencesOuterTP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InnerClassTypeMultipleGeneric.java") + public void testInnerClassTypeMultipleGeneric() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InnerClassTypeMultipleGeneric.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InnerClassesInGeneric.java") + public void testInnerClassesInGeneric() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InnerClassesInGeneric.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InnerOfGeneric.java") + public void testInnerOfGeneric() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/InnerOfGeneric.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("IntrinsicCompanionObject.java") + public void testIntrinsicCompanionObject() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/IntrinsicCompanionObject.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodReferencesOuterClassTP.java") + public void testMethodReferencesOuterClassTP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodReferencesOuterClassTP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodTypePOneUpperBound.java") + public void testMethodTypePOneUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodTypePOneUpperBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodTypePTwoUpperBounds.java") + public void testMethodTypePTwoUpperBounds() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodTypePTwoUpperBounds.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithTypeP.java") + public void testMethodWithTypeP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodWithTypeP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithTypePP.java") + public void testMethodWithTypePP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodWithTypePP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithTypePRefClassP.java") + public void testMethodWithTypePRefClassP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodWithTypePRefClassP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethosWithPRefTP.java") + public void testMethosWithPRefTP() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethosWithPRefTP.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MyException.java") + public void testMyException() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MyException.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NestedClass.java") + public void testNestedClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/NestedClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("OverrideMethod.java") + public void testOverrideMethod() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/OverrideMethod.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PackageLocalVisibility.java") + public void testPackageLocalVisibility() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/PackageLocalVisibility.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PrivateMembers.java") + public void testPrivateMembers() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/PrivateMembers.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PrivateMembersInHierarchy.java") + public void testPrivateMembersInHierarchy() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/PrivateMembersInHierarchy.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RawOverrides.java") + public void testRawOverrides() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/RawOverrides.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RawTypeWithUpperBound.java") + public void testRawTypeWithUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/RawTypeWithUpperBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RawUpperBound.java") + public void testRawUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/RawUpperBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RecursiveRawUpperBound.java") + public void testRecursiveRawUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/RecursiveRawUpperBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RecursiveWildcardUpperBound.java") + public void testRecursiveWildcardUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/RecursiveWildcardUpperBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RemoveRedundantProjectionKind.java") + public void testRemoveRedundantProjectionKind() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/RemoveRedundantProjectionKind.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Simple.java") + public void testSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/Simple.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubclassFromNested.java") + public void testSubclassFromNested() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/SubclassFromNested.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TopLevel$Class.java") + public void testTopLevel$Class() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/TopLevel$Class.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoFields.java") + public void testTwoFields() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/TwoFields.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("UnboundWildcard.java") + public void testUnboundWildcard() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/UnboundWildcard.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("WildcardBounds.java") + public void testWildcardBounds() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/WildcardBounds.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/annotations") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Annotations extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInAnnotations() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/annotations"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("AnnotatedAnnotation.java") + public void testAnnotatedAnnotation() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotatedAnnotation.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotatedConstructor.java") + public void testAnnotatedConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotatedConstructor.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotatedEnumEntry.java") + public void testAnnotatedEnumEntry() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotatedEnumEntry.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotatedField.java") + public void testAnnotatedField() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotatedField.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotatedMethod.java") + public void testAnnotatedMethod() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotatedMethod.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotatedValueParameter.java") + public void testAnnotatedValueParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotatedValueParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotationInParam.java") + public void testAnnotationInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotationInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotationRetentions.java") + public void testAnnotationRetentions() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotationRetentions.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AnnotationTargets.java") + public void testAnnotationTargets() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/AnnotationTargets.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ArithmeticExpressionInParam.java") + public void testArithmeticExpressionInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/ArithmeticExpressionInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ArrayOfEnumInParam.java") + public void testArrayOfEnumInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/ArrayOfEnumInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ArrayOfStringInParam.java") + public void testArrayOfStringInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/ArrayOfStringInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassObjectArrayInParam.java") + public void testClassObjectArrayInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/ClassObjectArrayInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassObjectInParam.java") + public void testClassObjectInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/ClassObjectInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassObjectInParamRaw.java") + public void testClassObjectInParamRaw() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/ClassObjectInParamRaw.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ClassObjectInParamVariance.java") + public void testClassObjectInParamVariance() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/ClassObjectInParamVariance.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("CustomAnnotation.java") + public void testCustomAnnotation() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/CustomAnnotation.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("CustomAnnotationWithDefaultParameter.java") + public void testCustomAnnotationWithDefaultParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/CustomAnnotationWithDefaultParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("EmptyArrayInParam.java") + public void testEmptyArrayInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/EmptyArrayInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("EnumArgumentWithCustomToString.java") + public void testEnumArgumentWithCustomToString() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/EnumArgumentWithCustomToString.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("EnumConstructorParameter.java") + public void testEnumConstructorParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/EnumConstructorParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("EnumInParam.java") + public void testEnumInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/EnumInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("JavaDocDeprecated.java") + public void testJavaDocDeprecated() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/JavaDocDeprecated.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NestedEnumArgument.java") + public void testNestedEnumArgument() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/NestedEnumArgument.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PrimitiveValueInParam.java") + public void testPrimitiveValueInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/PrimitiveValueInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RecursiveAnnotation.java") + public void testRecursiveAnnotation() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RecursiveAnnotation2.java") + public void testRecursiveAnnotation2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/RecursiveAnnotation2.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SimpleAnnotation.java") + public void testSimpleAnnotation() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/SimpleAnnotation.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StringConcatenationInParam.java") + public void testStringConcatenationInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/StringConcatenationInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StringConstantInParam.java") + public void testStringConstantInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/StringConstantInParam.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StringInParam.java") + public void testStringInParam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/annotations/StringInParam.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/constructor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Constructor extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInConstructor() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/constructor"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ConstructorGenericDeep.java") + public void testConstructorGenericDeep() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericDeep.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ConstructorGenericSimple.java") + public void testConstructorGenericSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericSimple.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ConstructorGenericUpperBound.java") + public void testConstructorGenericUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/constructor/ConstructorGenericUpperBound.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/enum") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Enum extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInEnum() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/enum"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("EnumMembers.java") + public void testEnumMembers() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/EnumMembers.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("EnumWithSpecializedEntry.java") + public void testEnumWithSpecializedEntry() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("JavaEnum.java") + public void testJavaEnum() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/JavaEnum.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/javaBean") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JavaBean extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInJavaBean() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/javaBean"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("DifferentGetterAndSetter.java") + public void testDifferentGetterAndSetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/javaBean/DifferentGetterAndSetter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("JavaBeanAbstractGetter.java") + public void testJavaBeanAbstractGetter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/javaBean/JavaBeanAbstractGetter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("JavaBeanVal.java") + public void testJavaBeanVal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/javaBean/JavaBeanVal.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("JavaBeanVar.java") + public void testJavaBeanVar() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/javaBean/JavaBeanVar.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("JavaBeanVarOfGenericType.java") + public void testJavaBeanVarOfGenericType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/javaBean/JavaBeanVarOfGenericType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSetters.java") + public void testTwoSetters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/javaBean/TwoSetters.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class KotlinSignature extends AbstractLoadJavaWithFastClassReadingTest { + @TestMetadata("AllBoundsInWhen.java") + public void testAllBoundsInWhen() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/AllBoundsInWhen.java"); + doTestCompiledJava(fileName); + } + + public void testAllFilesPresentInKotlinSignature() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/kotlinSignature"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ArrayType.java") + public void testArrayType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/ArrayType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ConstructorWithNewTypeParams.java") + public void testConstructorWithNewTypeParams() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithNewTypeParams.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ConstructorWithParentTypeParams.java") + public void testConstructorWithParentTypeParams() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithParentTypeParams.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ConstructorWithSeveralParams.java") + public void testConstructorWithSeveralParams() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithSeveralParams.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ConstructorWithoutParams.java") + public void testConstructorWithoutParams() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/ConstructorWithoutParams.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("CustomProjectionKind.java") + public void testCustomProjectionKind() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/CustomProjectionKind.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithFunctionTypes.java") + public void testMethodWithFunctionTypes() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithFunctionTypes.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithGenerics.java") + public void testMethodWithGenerics() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithGenerics.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithMappedClasses.java") + public void testMethodWithMappedClasses() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithMappedClasses.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithTypeParameters.java") + public void testMethodWithTypeParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithTypeParameters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodWithVararg.java") + public void testMethodWithVararg() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/MethodWithVararg.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PropertyArrayTypes.java") + public void testPropertyArrayTypes() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyArrayTypes.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PropertyComplexTypes.java") + public void testPropertyComplexTypes() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/PropertyComplexTypes.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PropertySimpleType.java") + public void testPropertySimpleType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/PropertySimpleType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StarProjection.java") + public void testStarProjection() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/StarProjection.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/error") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Error extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInError() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/kotlinSignature/error"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("WrongProjectionKind.java") + public void testWrongProjectionKind() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongProjectionKind.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("WrongReturnTypeStructure.java") + public void testWrongReturnTypeStructure() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongReturnTypeStructure.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("WrongTypeParameterBoundStructure1.java") + public void testWrongTypeParameterBoundStructure1() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongTypeParameterBoundStructure1.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("WrongValueParameterStructure1.java") + public void testWrongValueParameterStructure1() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/error/WrongValueParameterStructure1.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Propagation extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInPropagation() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("PropagateTypeArgumentNullable.java") + public void testPropagateTypeArgumentNullable() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/PropagateTypeArgumentNullable.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Parameter extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInParameter() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ChangeProjectionKind1.java") + public void testChangeProjectionKind1() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/ChangeProjectionKind1.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("DeeplySubstitutedClassParameter.java") + public void testDeeplySubstitutedClassParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/DeeplySubstitutedClassParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("DeeplySubstitutedClassParameter2.java") + public void testDeeplySubstitutedClassParameter2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/DeeplySubstitutedClassParameter2.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNotVararg.java") + public void testInheritNotVararg() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritNotVararg.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNotVarargInteger.java") + public void testInheritNotVarargInteger() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritNotVarargInteger.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNotVarargNotNull.java") + public void testInheritNotVarargNotNull() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritNotVarargNotNull.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNotVarargPrimitive.java") + public void testInheritNotVarargPrimitive() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritNotVarargPrimitive.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNullability.java") + public void testInheritNullability() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritNullability.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritVararg.java") + public void testInheritVararg() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritVararg.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritVarargInteger.java") + public void testInheritVarargInteger() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritVarargInteger.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritVarargNotNull.java") + public void testInheritVarargNotNull() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritVarargNotNull.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritVarargPrimitive.java") + public void testInheritVarargPrimitive() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/InheritVarargPrimitive.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Kt3302.java") + public void testKt3302() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/Kt3302.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MutableToReadOnly.java") + public void testMutableToReadOnly() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/MutableToReadOnly.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NotNullToNullable.java") + public void testNotNullToNullable() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/NotNullToNullable.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NullableToNotNull.java") + public void testNullableToNotNull() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/NullableToNotNull.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NullableToNotNullKotlinSignature.java") + public void testNullableToNotNullKotlinSignature() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/NullableToNotNullKotlinSignature.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("OverrideWithErasedParameter.java") + public void testOverrideWithErasedParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/OverrideWithErasedParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ReadOnlyToMutable.java") + public void testReadOnlyToMutable() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/ReadOnlyToMutable.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubclassFromGenericAndNot.java") + public void testSubclassFromGenericAndNot() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/SubclassFromGenericAndNot.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubstitutedClassParameter.java") + public void testSubstitutedClassParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/SubstitutedClassParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubstitutedClassParameters.java") + public void testSubstitutedClassParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/parameter/SubstitutedClassParameters.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Return extends AbstractLoadJavaWithFastClassReadingTest { + @TestMetadata("AddNotNullJavaSubtype.java") + public void testAddNotNullJavaSubtype() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/AddNotNullJavaSubtype.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AddNotNullSameJavaType.java") + public void testAddNotNullSameJavaType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/AddNotNullSameJavaType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AddNullabilityJavaSubtype.java") + public void testAddNullabilityJavaSubtype() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/AddNullabilityJavaSubtype.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AddNullabilitySameGenericType1.java") + public void testAddNullabilitySameGenericType1() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/AddNullabilitySameGenericType1.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AddNullabilitySameGenericType2.java") + public void testAddNullabilitySameGenericType2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/AddNullabilitySameGenericType2.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("AddNullabilitySameJavaType.java") + public void testAddNullabilitySameJavaType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/AddNullabilitySameJavaType.java"); + doTestCompiledJava(fileName); + } + + public void testAllFilesPresentInReturn() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("CantMakeImmutableInSubclass.java") + public void testCantMakeImmutableInSubclass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/CantMakeImmutableInSubclass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("DeeplySubstitutedClassParameter.java") + public void testDeeplySubstitutedClassParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/DeeplySubstitutedClassParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("DeeplySubstitutedClassParameter2.java") + public void testDeeplySubstitutedClassParameter2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/DeeplySubstitutedClassParameter2.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("HalfSubstitutedTypeParameters.java") + public void testHalfSubstitutedTypeParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/HalfSubstitutedTypeParameters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNullabilityGenericSubclassSimple.java") + public void testInheritNullabilityGenericSubclassSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritNullabilityGenericSubclassSimple.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNullabilityJavaSubtype.java") + public void testInheritNullabilityJavaSubtype() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritNullabilityJavaSubtype.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNullabilitySameGenericType.java") + public void testInheritNullabilitySameGenericType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritNullabilitySameGenericType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritNullabilitySameJavaType.java") + public void testInheritNullabilitySameJavaType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritNullabilitySameJavaType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritProjectionKind.java") + public void testInheritProjectionKind() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritProjectionKind.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritReadOnlinessOfArgument.java") + public void testInheritReadOnlinessOfArgument() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritReadOnlinessOfArgument.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritReadOnlinessSameClass.java") + public void testInheritReadOnlinessSameClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritReadOnlinessSameClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritReadOnlinessSubclass.java") + public void testInheritReadOnlinessSubclass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/InheritReadOnlinessSubclass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SameProjectionKind.java") + public void testSameProjectionKind() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SameProjectionKind.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubclassFromGenericAndNot.java") + public void testSubclassFromGenericAndNot() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassFromGenericAndNot.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubclassOfCollection.java") + public void testSubclassOfCollection() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfCollection.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubclassOfMapEntry.java") + public void testSubclassOfMapEntry() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubclassOfMapEntry.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubstitutedClassParameter.java") + public void testSubstitutedClassParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubstitutedClassParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubstitutedClassParameters.java") + public void testSubstitutedClassParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/SubstitutedClassParameters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesConflictingProjectionKinds.java") + public void testTwoSuperclassesConflictingProjectionKinds() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TwoSuperclassesConflictingProjectionKinds.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesInvariantAndCovariantInferMutability.java") + public void testTwoSuperclassesInvariantAndCovariantInferMutability() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TwoSuperclassesInvariantAndCovariantInferMutability.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesInvariantAndCovariantInferNullability.java") + public void testTwoSuperclassesInvariantAndCovariantInferNullability() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TwoSuperclassesInvariantAndCovariantInferNullability.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesMutableAndNot.java") + public void testTwoSuperclassesMutableAndNot() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TwoSuperclassesMutableAndNot.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesReturnJavaSubtype.java") + public void testTwoSuperclassesReturnJavaSubtype() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TwoSuperclassesReturnJavaSubtype.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesReturnSameJavaType.java") + public void testTwoSuperclassesReturnSameJavaType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TwoSuperclassesReturnSameJavaType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesSupplementNotNull.java") + public void testTwoSuperclassesSupplementNotNull() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TwoSuperclassesSupplementNotNull.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TypeParamOfClass.java") + public void testTypeParamOfClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TypeParamOfClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TypeParamOfClassSubstituted.java") + public void testTypeParamOfClassSubstituted() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TypeParamOfClassSubstituted.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TypeParamOfFun.java") + public void testTypeParamOfFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/return/TypeParamOfFun.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class TypeParameter extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInTypeParameter() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("InheritNullability.java") + public void testInheritNullability() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter/InheritNullability.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoBounds.java") + public void testTwoBounds() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter/TwoBounds.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclasses.java") + public void testTwoSuperclasses() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter/TwoSuperclasses.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoTypeParameters.java") + public void testTwoTypeParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter/TwoTypeParameters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("UseParameterAsUpperBound.java") + public void testUseParameterAsUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter/UseParameterAsUpperBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("UseParameterInUpperBound.java") + public void testUseParameterInUpperBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter/UseParameterInUpperBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("UseParameterInUpperBoundWithKotlinSignature.java") + public void testUseParameterInUpperBoundWithKotlinSignature() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/kotlinSignature/propagation/typeParameter/UseParameterInUpperBoundWithKotlinSignature.java"); + doTestCompiledJava(fileName); + } + } + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/library") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Library extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInLibrary() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/library"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("LoadIterable.java") + public void testLoadIterable() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/library/LoadIterable.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("LoadIterator.java") + public void testLoadIterator() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/library/LoadIterator.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Max.java") + public void testMax() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/library/Max.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/modality") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Modality extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInModality() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/modality"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ModalityOfFakeOverrides.java") + public void testModalityOfFakeOverrides() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/mutability") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Mutability extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInMutability() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/mutability"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("LoadIterable.java") + public void testLoadIterable() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/mutability/LoadIterable.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("LoadIterableWithConflict.java") + public void testLoadIterableWithConflict() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithConflict.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("LoadIterableWithNullability.java") + public void testLoadIterableWithNullability() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("LoadIterableWithPropagation.java") + public void testLoadIterableWithPropagation() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithPropagation.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ReadOnlyExtendsWildcard.java") + public void testReadOnlyExtendsWildcard() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/mutability/ReadOnlyExtendsWildcard.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/notNull") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class NotNull extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInNotNull() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/notNull"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("NotNullField.java") + public void testNotNullField() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/notNull/NotNullField.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NotNullIntArray.java") + public void testNotNullIntArray() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/notNull/NotNullIntArray.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NotNullMethod.java") + public void testNotNullMethod() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/notNull/NotNullMethod.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NotNullObjectArray.java") + public void testNotNullObjectArray() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/notNull/NotNullObjectArray.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NotNullParameter.java") + public void testNotNullParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/notNull/NotNullParameter.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/protectedPackage") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedPackage extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInProtectedPackage() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/protectedPackage"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ProtectedPackageConstructor.java") + public void testProtectedPackageConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/protectedPackage/ProtectedPackageConstructor.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ProtectedPackageFun.java") + public void testProtectedPackageFun() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/protectedPackage/ProtectedPackageFun.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ProtectedPackageProperty.java") + public void testProtectedPackageProperty() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/protectedPackage/ProtectedPackageProperty.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/protectedStatic") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedStatic extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInProtectedStatic() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/protectedStatic"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ConstructorInProtectedStaticNestedClass.java") + public void testConstructorInProtectedStaticNestedClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/protectedStatic/ConstructorInProtectedStaticNestedClass.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/rendering") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Rendering extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInRendering() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/rendering"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("Rendering.java") + public void testRendering() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/rendering/Rendering.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/sam") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Sam extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInSam() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/sam"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("Comparator.java") + public void testComparator() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/Comparator.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("DifferentParametersCount.java") + public void testDifferentParametersCount() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/DifferentParametersCount.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("FilenameFilter.java") + public void testFilenameFilter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/FilenameFilter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("GenericInterfaceParameterWithSelfBound.java") + public void testGenericInterfaceParameterWithSelfBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParameterWithSelfBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("GenericInterfaceParametersWithBounds.java") + public void testGenericInterfaceParametersWithBounds() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/GenericInterfaceParametersWithBounds.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("GenericMethodParameters.java") + public void testGenericMethodParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/GenericMethodParameters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InterfaceWithObjectMethod.java") + public void testInterfaceWithObjectMethod() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/InterfaceWithObjectMethod.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Nested.java") + public void testNested() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/Nested.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Runnable.java") + public void testRunnable() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/Runnable.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SamSubinterfaceOfTwo.java") + public void testSamSubinterfaceOfTwo() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOfTwo.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SamSubinterfaceOverridding.java") + public void testSamSubinterfaceOverridding() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/SamSubinterfaceOverridding.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StaticOverrides.java") + public void testStaticOverrides() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/StaticOverrides.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubstitutedSamInterface.java") + public void testSubstitutedSamInterface() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterface.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubstitutedSamInterfaceSubclassOfBuiltin.java") + public void testSubstitutedSamInterfaceSubclassOfBuiltin() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/SubstitutedSamInterfaceSubclassOfBuiltin.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("VarargParameter.java") + public void testVarargParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/VarargParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/sam/adapters") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Adapters extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInAdapters() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/sam/adapters"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("AmbiguousAdapters.java") + public void testAmbiguousAdapters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/AmbiguousAdapters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Basic.java") + public void testBasic() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/Basic.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Constructor.java") + public void testConstructor() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/Constructor.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ConstructorWithAnnotations.java") + public void testConstructorWithAnnotations() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/ConstructorWithAnnotations.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("DeepSamLoop.java") + public void testDeepSamLoop() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/DeepSamLoop.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NoSamForClassTypeParameter.java") + public void testNoSamForClassTypeParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/NoSamForClassTypeParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NoSamForMethodTypeParameter.java") + public void testNoSamForMethodTypeParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/NoSamForMethodTypeParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("NonTrivialFunctionType.java") + public void testNonTrivialFunctionType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/NonTrivialFunctionType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("PrivateSamAdapter.java") + public void testPrivateSamAdapter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/PrivateSamAdapter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SelfAsParameter.java") + public void testSelfAsParameter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/SelfAsParameter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SeveralSamParameters.java") + public void testSeveralSamParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/SeveralSamParameters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TypeParameterOfClass.java") + public void testTypeParameterOfClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TypeParameterOfMethod.java") + public void testTypeParameterOfMethod() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TypeParameterOfOuterClass.java") + public void testTypeParameterOfOuterClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfOuterClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Inheritance extends AbstractLoadJavaWithFastClassReadingTest { + @TestMetadata("AdapterDoesntOverrideDeclaration.java") + public void testAdapterDoesntOverrideDeclaration() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/AdapterDoesntOverrideDeclaration.java"); + doTestCompiledJava(fileName); + } + + public void testAllFilesPresentInInheritance() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("InheritedAdapterAndDeclaration.java") + public void testInheritedAdapterAndDeclaration() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedAdapterAndDeclaration.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritedAmbiguousAdapters.java") + public void testInheritedAmbiguousAdapters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedAmbiguousAdapters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritedAndOverriddenAmbiguousAdapters.java") + public void testInheritedAndOverriddenAmbiguousAdapters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedAndOverriddenAmbiguousAdapters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritedOverridden.java") + public void testInheritedOverridden() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedOverridden.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritedOverriddenAdapter.java") + public void testInheritedOverriddenAdapter() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedOverriddenAdapter.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritedSameAdapters.java") + public void testInheritedSameAdapters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdapters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritedSameAdaptersWithSubstitution.java") + public void testInheritedSameAdaptersWithSubstitution() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSameAdaptersWithSubstitution.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InheritedSimple.java") + public void testInheritedSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/InheritedSimple.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("OverriddenAmbiguousAdapters.java") + public void testOverriddenAmbiguousAdapters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/inheritance/OverriddenAmbiguousAdapters.java"); + doTestCompiledJava(fileName); + } + } + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SignaturePropagation extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInSignaturePropagation() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/signaturePropagation"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("ArraysInSubtypes.java") + public void testArraysInSubtypes() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/ArraysInSubtypes.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("MethodTypeParameterErased.java") + public void testMethodTypeParameterErased() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/MethodTypeParameterErased.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RawSuperType.java") + public void testRawSuperType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RawSuperTypeWithBound.java") + public void testRawSuperTypeWithBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RawSuperTypeWithRecursiveBound.java") + public void testRawSuperTypeWithRecursiveBound() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBound.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("RawSuperTypeWithRecursiveBoundMultipleParameters.java") + public void testRawSuperTypeWithRecursiveBoundMultipleParameters() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/RawSuperTypeWithRecursiveBoundMultipleParameters.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("ReturnInnerSubclassOfSupersInner.java") + public void testReturnInnerSubclassOfSupersInner() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/ReturnInnerSubclassOfSupersInner.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("SubclassWithRawType.java") + public void testSubclassWithRawType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/SubclassWithRawType.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("TwoSuperclassesInconsistentGenericTypes.java") + public void testTwoSuperclassesInconsistentGenericTypes() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/signaturePropagation/TwoSuperclassesInconsistentGenericTypes.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/static") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Static extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInStatic() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/static"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("DeeplyInnerClass.java") + public void testDeeplyInnerClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/DeeplyInnerClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("DeeplyNestedStatic.java") + public void testDeeplyNestedStatic() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/DeeplyNestedStatic.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Enum.java") + public void testEnum() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/Enum.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("InnerClass.java") + public void testInnerClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/InnerClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("Simple.java") + public void testSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/Simple.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StaticFinal.java") + public void testStaticFinal() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticFinal.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StaticMembersFromParentClass.java") + public void testStaticMembersFromParentClass() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersFromParentClass.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StaticMembersFromParentClassVisibility.java") + public void testStaticMembersFromParentClassVisibility() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersFromParentClassVisibility.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StaticMembersFromParentInterface.java") + public void testStaticMembersFromParentInterface() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersFromParentInterface.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StaticMembersInEnum.java") + public void testStaticMembersInEnum() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersInEnum.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("StaticMembersInEnumFromParents.java") + public void testStaticMembersInEnumFromParents() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/static/StaticMembersInEnumFromParents.java"); + doTestCompiledJava(fileName); + } + } + + @TestMetadata("compiler/testData/loadJava/compiledJava/vararg") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Vararg extends AbstractLoadJavaWithFastClassReadingTest { + public void testAllFilesPresentInVararg() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/vararg"), Pattern.compile("^(.+)\\.java$"), TargetBackend.ANY, true); + } + + @TestMetadata("VarargInt.java") + public void testVarargInt() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/vararg/VarargInt.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("VarargString.java") + public void testVarargString() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/vararg/VarargString.java"); + doTestCompiledJava(fileName); + } + } +} diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index e7f749d1e5e..77e26f100e6 100755 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -327,6 +327,10 @@ fun main(args: Array) { model("loadJava/compiledJava", extension = "java", excludeDirs = listOf("sam", "kotlinSignature/propagation")) } + testClass { + model("loadJava/compiledJava", extension = "java", testMethod = "doTestCompiledJava") + } + testClass { model("compileJavaAgainstKotlin") }