Reuse class loader for kotlin-runtime.jar in codegen tests

Also delete questionable ClassPathInParentClassLoaderTest
This commit is contained in:
Alexander Udalov
2015-02-25 14:23:21 +03:00
parent b99b1883bc
commit 6f0ccbfab8
9 changed files with 63 additions and 125 deletions
@@ -20,8 +20,6 @@ import com.intellij.testFramework.UsefulTestCase;
import org.jetbrains.kotlin.codegen.forTestCompile.ForTestCompileRuntime;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
public class ProgressionUtilTest extends UsefulTestCase {
private static final int MAX = Integer.MAX_VALUE;
@@ -33,8 +31,7 @@ public class ProgressionUtilTest extends UsefulTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
ClassLoader classLoader = new URLClassLoader(new URL[] {ForTestCompileRuntime.runtimeJarForTests().toURI().toURL()}, null);
Class<?> progressionUtil = classLoader.loadClass("kotlin.internal.InternalPackage");
Class<?> progressionUtil = ForTestCompileRuntime.runtimeJarClassLoader().loadClass("kotlin.internal.InternalPackage");
this.intMethod = progressionUtil.getMethod("getProgressionFinalElement", int.class, int.class, int.class);
this.longMethod = progressionUtil.getMethod("getProgressionFinalElement", long.class, long.class, long.class);
}