Access to test root disposable through accessor
This commit is contained in:
committed by
Nikolay Krasko
parent
272ccf64ae
commit
6c968859ad
+2
-2
@@ -64,7 +64,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
||||
List<File> kotlinSources = FileUtil.findFilesByMask(Pattern.compile(".+\\.kt"), sourcesDir);
|
||||
|
||||
KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForTests(
|
||||
myTestRootDisposable, newConfiguration(ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, getClasspath(),
|
||||
getTestRootDisposable(), newConfiguration(ConfigurationKind.JDK_ONLY, TestJdkKind.MOCK_JDK, getClasspath(),
|
||||
Collections.emptyList()), EnvironmentConfigFiles.JVM_CONFIG_FILES
|
||||
);
|
||||
registerJavacIfNeeded(environment);
|
||||
@@ -309,7 +309,7 @@ public abstract class AbstractLoadJavaTest extends TestCaseWithTmpdir {
|
||||
@NotNull ConfigurationKind configurationKind
|
||||
) throws IOException {
|
||||
compileJavaWithAnnotationsJar(javaFiles, outDir);
|
||||
return loadTestPackageAndBindingContextFromJavaRoot(outDir, myTestRootDisposable, getJdkKind(), configurationKind, true,
|
||||
return loadTestPackageAndBindingContextFromJavaRoot(outDir, getTestRootDisposable(), getJdkKind(), configurationKind, true,
|
||||
usePsiClassFilesReading(), useJavacWrapper(), null,
|
||||
getExtraClasspath(), this::configureEnvironment);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ class LoadJavaPackageAnnotationsTest : KtUsefulTestCase() {
|
||||
}
|
||||
val environment =
|
||||
KotlinCoreEnvironment.createForTests(
|
||||
myTestRootDisposable,
|
||||
testRootDisposable,
|
||||
configuration,
|
||||
EnvironmentConfigFiles.JVM_CONFIG_FILES
|
||||
).apply {
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.jetbrains.kotlin.types.upperIfFlexible
|
||||
class MemoryOptimizationsTest : KtUsefulTestCase() {
|
||||
fun testBasicFlexibleTypeCase() {
|
||||
val moduleDescriptor = JvmResolveUtil.analyze(
|
||||
KotlinTestUtils.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea(myTestRootDisposable, ConfigurationKind.ALL, TestJdkKind.FULL_JDK)
|
||||
KotlinTestUtils.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea(testRootDisposable, ConfigurationKind.ALL, TestJdkKind.FULL_JDK)
|
||||
).moduleDescriptor
|
||||
|
||||
val appendableClass =
|
||||
@@ -71,7 +71,7 @@ class MemoryOptimizationsTest : KtUsefulTestCase() {
|
||||
val environment =
|
||||
KotlinTestUtils
|
||||
.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea(
|
||||
myTestRootDisposable, ConfigurationKind.ALL, TestJdkKind.FULL_JDK
|
||||
testRootDisposable, ConfigurationKind.ALL, TestJdkKind.FULL_JDK
|
||||
)
|
||||
val moduleDescriptor =
|
||||
JvmResolveUtil.analyze(
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ class TypeQualifierAnnotationResolverTest : KtUsefulTestCase() {
|
||||
)
|
||||
}
|
||||
|
||||
val environment = KotlinCoreEnvironment.createForTests(myTestRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
val environment = KotlinCoreEnvironment.createForTests(testRootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
|
||||
val container = JvmResolveUtil.createContainer(environment)
|
||||
val typeQualifierResolver = container.get<JavaResolverComponents>().annotationTypeQualifierResolver
|
||||
|
||||
|
||||
+4
-4
@@ -14,6 +14,9 @@ import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations
|
||||
import org.jetbrains.kotlin.descriptors.impl.PackageFragmentDescriptorImpl
|
||||
import org.jetbrains.kotlin.descriptors.runtime.components.ReflectKotlinClass
|
||||
import org.jetbrains.kotlin.descriptors.runtime.components.RuntimeModuleData
|
||||
import org.jetbrains.kotlin.descriptors.runtime.structure.classId
|
||||
import org.jetbrains.kotlin.incremental.components.LookupLocation
|
||||
import org.jetbrains.kotlin.jvm.compiler.ExpectedLoadErrorsUtil
|
||||
import org.jetbrains.kotlin.jvm.compiler.LoadDescriptorUtil
|
||||
@@ -38,9 +41,6 @@ import java.io.File
|
||||
import java.net.URLClassLoader
|
||||
import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
import org.jetbrains.kotlin.descriptors.runtime.components.ReflectKotlinClass
|
||||
import org.jetbrains.kotlin.descriptors.runtime.components.RuntimeModuleData
|
||||
import org.jetbrains.kotlin.descriptors.runtime.structure.classId
|
||||
|
||||
abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
|
||||
companion object {
|
||||
@@ -129,7 +129,7 @@ abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
|
||||
}
|
||||
fileName.endsWith(".kt") -> {
|
||||
val environment = KotlinTestUtils.createEnvironmentWithJdkAndNullabilityAnnotationsFromIdea(
|
||||
myTestRootDisposable, ConfigurationKind.ALL, jdkKind
|
||||
testRootDisposable, ConfigurationKind.ALL, jdkKind
|
||||
)
|
||||
for (root in environment.configuration.getList(CLIConfigurationKeys.CONTENT_ROOTS)) {
|
||||
LOG.info("root: $root")
|
||||
|
||||
Reference in New Issue
Block a user