diff --git a/compiler/tests/org/jetbrains/jet/CompileStdlibTest.java b/compiler/tests/org/jetbrains/jet/CompileStdlibTest.java index 37961d1ff01..c960df45c3a 100644 --- a/compiler/tests/org/jetbrains/jet/CompileStdlibTest.java +++ b/compiler/tests/org/jetbrains/jet/CompileStdlibTest.java @@ -16,7 +16,7 @@ package org.jetbrains.jet; -import org.jetbrains.jet.codegen.ForTestCompileStdlib; +import org.jetbrains.jet.codegen.ForTestCompileRuntime; import org.junit.Test; /** @@ -26,7 +26,7 @@ public class CompileStdlibTest { @Test public void compile() { - ForTestCompileStdlib.stdlibJarForTests(); + ForTestCompileRuntime.runtimeJarForTests(); } } diff --git a/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.java b/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileRuntime.java similarity index 88% rename from compiler/tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.java rename to compiler/tests/org/jetbrains/jet/codegen/ForTestCompileRuntime.java index 32a6580a7ed..ae8afb2ffba 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileRuntime.java @@ -38,26 +38,26 @@ import java.util.jar.JarOutputStream; /** * Compile stdlib.jar that can be used in tests * - * @see #stdlibJarForTests() + * @see #runtimeJarForTests * * @author Stepan Koltsov */ -public class ForTestCompileStdlib { +public class ForTestCompileRuntime { private static File stdlibJarFile; - private ForTestCompileStdlib() { + private ForTestCompileRuntime() { } private static File doCompile() throws Exception { - File tmpDir = JetTestUtils.tmpDir("stdlibjar"); + File tmpDir = JetTestUtils.tmpDir("runtimejar"); - File jarFile = new File(tmpDir, "stdlib.jar"); + File jarFile = new File(tmpDir, "runtime.jar"); File classesDir = new File(tmpDir, "classes"); FileUtil.createParentDirs(new File(classesDir, "dummy")); - compileJavaPartOfStdlib(classesDir); - compileKotlinPartOfStdlib(classesDir); + compileJavaPartOfBuiltins(classesDir); + compileStdlib(classesDir); FileOutputStream stdlibJar = new FileOutputStream(jarFile); try { @@ -97,7 +97,7 @@ public class ForTestCompileStdlib { } } - private static void compileKotlinPartOfStdlib(File destdir) throws IOException { + private static void compileStdlib(File destdir) throws IOException { KotlinCompiler.ExitCode exitCode = new KotlinCompiler().exec(System.err, "-output", destdir.getPath(), "-src", "./libraries/stdlib/src", @@ -123,7 +123,7 @@ public class ForTestCompileStdlib { return r; } - private static void compileJavaPartOfStdlib(File destdir) throws IOException { + private static void compileJavaPartOfBuiltins(File destdir) throws IOException { JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler(); StandardJavaFileManager fileManager = javaCompiler.getStandardFileManager(null, Locale.ENGLISH, Charset.forName("utf-8")); @@ -144,10 +144,10 @@ public class ForTestCompileStdlib { private static Throwable compilationException; - public static File stdlibJarForTests() { - synchronized (ForTestCompileStdlib.class) { + public static File runtimeJarForTests() { + synchronized (ForTestCompileRuntime.class) { if (compilationException != null) { - throw new RuntimeException("stdlib compilation failed in previous tests: " + compilationException, compilationException); + throw new RuntimeException("runtime compilation failed in previous tests: " + compilationException, compilationException); } if (stdlibJarFile == null || !stdlibJarFile.exists()) { try { diff --git a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java index b2366b64fee..50a30e00cb9 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/StdlibTest.java @@ -37,7 +37,7 @@ public class StdlibTest extends CodegenTestCase { protected void setUp() throws Exception { super.setUp(); createEnvironmentWithFullJdk(); - myEnvironment.addToClasspath(ForTestCompileStdlib.stdlibJarForTests()); + myEnvironment.addToClasspath(ForTestCompileRuntime.runtimeJarForTests()); File junitJar = new File("libraries/lib/junit-4.9.jar"); if (!junitJar.exists()) { @@ -52,7 +52,7 @@ public class StdlibTest extends CodegenTestCase { protected GeneratedClassLoader createClassLoader(ClassFileFactory codegens) throws MalformedURLException { return new GeneratedClassLoader( codegens, - new URLClassLoader(new URL[]{ForTestCompileStdlib.stdlibJarForTests().toURI().toURL()}, + new URLClassLoader(new URL[]{ForTestCompileRuntime.runtimeJarForTests().toURI().toURL()}, getClass().getClassLoader())); } diff --git a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java index 31929f0178a..f3214341c65 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java +++ b/compiler/tests/org/jetbrains/jet/codegen/TestlibTest.java @@ -73,7 +73,7 @@ public class TestlibTest extends CodegenTestCase { try { CompileSession session = new CompileSession(myEnvironment, MessageRenderer.PLAIN, System.err, false, CompilerSpecialMode.REGULAR); - myEnvironment.addToClasspath(ForTestCompileStdlib.stdlibJarForTests()); + myEnvironment.addToClasspath(ForTestCompileRuntime.runtimeJarForTests()); File junitJar = new File("libraries/lib/junit-4.9.jar"); @@ -96,7 +96,7 @@ public class TestlibTest extends CodegenTestCase { final GeneratedClassLoader loader = new GeneratedClassLoader( classFileFactory, - new URLClassLoader(new URL[]{ForTestCompileStdlib.stdlibJarForTests().toURI().toURL(), junitJar.toURI().toURL()}, + new URLClassLoader(new URL[]{ForTestCompileRuntime.runtimeJarForTests().toURI().toURL(), junitJar.toURI().toURL()}, TestCase.class.getClassLoader())); JetTypeMapper typeMapper = state.getInjector().getJetTypeMapper(); diff --git a/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java b/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java index 9e1b2108b19..8cfd67a22df 100644 --- a/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java +++ b/compiler/tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.java @@ -19,7 +19,7 @@ package org.jetbrains.jet.compiler; import com.intellij.openapi.util.io.FileUtil; import junit.framework.TestCase; import org.jetbrains.jet.cli.KotlinCompiler; -import org.jetbrains.jet.codegen.ForTestCompileStdlib; +import org.jetbrains.jet.codegen.ForTestCompileRuntime; import org.jetbrains.jet.parsing.JetParsingTest; import org.junit.Assert; @@ -53,7 +53,7 @@ public class CompileEnvironmentTest extends TestCase { File tempDir = FileUtil.createTempDirectory("compilerTest", "compilerTest"); try { - File stdlib = ForTestCompileStdlib.stdlibJarForTests(); + File stdlib = ForTestCompileRuntime.runtimeJarForTests(); File resultJar = new File(tempDir, "result.jar"); KotlinCompiler.ExitCode rv = new KotlinCompiler().exec("-module", JetParsingTest.getTestDataDir() + "/compiler/smoke/Smoke.kts", "-jar", resultJar.getAbsolutePath(), @@ -84,7 +84,7 @@ public class CompileEnvironmentTest extends TestCase { File tempDir = FileUtil.createTempDirectory("compilerTest", "compilerTest"); try { File out = new File(tempDir, "out"); - File stdlib = ForTestCompileStdlib.stdlibJarForTests(); + File stdlib = ForTestCompileRuntime.runtimeJarForTests(); KotlinCompiler.ExitCode exitCode = new KotlinCompiler().exec("-src", JetParsingTest.getTestDataDir() + "/compiler/smoke/Smoke.kt", "-output", out.getAbsolutePath(), "-stdlib", stdlib.getAbsolutePath()); diff --git a/idea/tests/org/jetbrains/jet/plugin/JetWithJdkAndRuntimeLightProjectDescriptor.java b/idea/tests/org/jetbrains/jet/plugin/JetWithJdkAndRuntimeLightProjectDescriptor.java index ecb5539d181..72f54c74cbc 100644 --- a/idea/tests/org/jetbrains/jet/plugin/JetWithJdkAndRuntimeLightProjectDescriptor.java +++ b/idea/tests/org/jetbrains/jet/plugin/JetWithJdkAndRuntimeLightProjectDescriptor.java @@ -29,7 +29,7 @@ import com.intellij.testFramework.LightProjectDescriptor; import org.apache.commons.lang.SystemUtils; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.codegen.ForTestCompileStdlib; +import org.jetbrains.jet.codegen.ForTestCompileRuntime; /** * @author Evgeny Gerashchenko @@ -54,7 +54,7 @@ public class JetWithJdkAndRuntimeLightProjectDescriptor implements LightProjectD @Override public void configureModule(@NotNull Module module, @NotNull ModifiableRootModel model, @Nullable ContentEntry contentEntry) { Library.ModifiableModel modifiableModel = model.getModuleLibraryTable().createLibrary("ktl").getModifiableModel(); - VirtualFile cd = JarFileSystem.getInstance().findFileByPath(ForTestCompileStdlib.stdlibJarForTests() + "!/"); + VirtualFile cd = JarFileSystem.getInstance().findFileByPath(ForTestCompileRuntime.runtimeJarForTests() + "!/"); assert cd != null; modifiableModel.addRoot(cd, OrderRootType.CLASSES); modifiableModel.commit();