Move TEST_MODULE_NAME to KotlinTestUtils and change value to "test-module"

This name is more generic and thus can be used everywhere, not only in Java
integration tests
This commit is contained in:
Alexander Udalov
2016-05-23 12:19:22 +03:00
parent 3ca77de924
commit 69343549b7
7 changed files with 26 additions and 25 deletions
@@ -37,7 +37,6 @@ import org.jetbrains.kotlin.renderer.DescriptorRendererModifier
import org.jetbrains.kotlin.renderer.OverrideRenderingPolicy
import org.jetbrains.kotlin.renderer.ParameterNameRenderingPolicy
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil
import org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
import org.jetbrains.kotlin.resolve.scopes.MemberScope
@@ -91,7 +90,7 @@ abstract class AbstractJvmRuntimeDescriptorLoaderTest : TestCaseWithTmpdir() {
val classLoader = URLClassLoader(arrayOf(tmpdir.toURI().toURL()), ForTestCompileRuntime.runtimeAndReflectJarClassLoader())
val actual = createReflectedPackageView(classLoader, JvmResolveUtil.TEST_MODULE_NAME)
val actual = createReflectedPackageView(classLoader, KotlinTestUtils.TEST_MODULE_NAME)
val comparatorConfiguration = Configuration(
/* checkPrimaryConstructors = */ fileName.endsWith(".kt"),
@@ -27,13 +27,12 @@ import org.jetbrains.kotlin.descriptors.PackagePartProvider;
import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.resolve.AnalyzingUtils;
import org.jetbrains.kotlin.resolve.jvm.TopDownAnalyzerFacadeForJVM;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import java.util.Collection;
import java.util.Collections;
public class JvmResolveUtil {
public static String TEST_MODULE_NAME = "java-integration-test";
@NotNull
public static AnalysisResult analyzeAndCheckForErrors(@NotNull KtFile file, @NotNull KotlinCoreEnvironment environment) {
return analyzeAndCheckForErrors(Collections.singleton(file), environment);
@@ -90,7 +89,7 @@ public class JvmResolveUtil {
@NotNull PackagePartProvider packagePartProvider
) {
return TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(
TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(project, TEST_MODULE_NAME),
TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(project, KotlinTestUtils.TEST_MODULE_NAME),
files, new CliLightClassGenerationSupport.CliBindingTrace(), configuration, packagePartProvider
);
}
@@ -98,6 +98,8 @@ import java.util.regex.Pattern;
import static org.jetbrains.kotlin.config.JVMConfigurationKeys.MODULE_NAME;
public class KotlinTestUtils {
public static String TEST_MODULE_NAME = "test-module";
public static final String TEST_GENERATOR_NAME = "org.jetbrains.kotlin.generators.tests.TestsPackage";
public static final String PLEASE_REGENERATE_TESTS = "Please regenerate tests (GenerateTests.kt)";
@@ -465,7 +467,7 @@ public class KotlinTestUtils {
JvmContentRootsKt.addJvmClasspathRoots(configuration, classpath);
configuration.put(MODULE_NAME, JvmResolveUtil.TEST_MODULE_NAME);
configuration.put(MODULE_NAME, TEST_MODULE_NAME);
return configuration;
}