suite.addTestSuite(class) won't work if passed TestCase instance has TestCase.class loaded by different classloader. It does so very silently (this is a note to reified generics haters)

This commit is contained in:
Maxim Shafirov
2012-01-25 17:00:30 +04:00
parent f527890437
commit 25b71cd6c9
@@ -74,11 +74,10 @@ public class TestlibTest extends CodegenTestCase {
ClassFileFactory classFileFactory = session.generate();
URLClassLoader dependenciesClassLoader = new URLClassLoader(new URL[] { junitJar.toURI().toURL() });
GeneratedClassLoader loader;
URLClassLoader parentClassLoader = new URLClassLoader(new URL[]{
ForTestCompileStdlib.stdlibJarForTests().toURI().toURL()}, dependenciesClassLoader);
loader = new GeneratedClassLoader(classFileFactory, parentClassLoader);
GeneratedClassLoader loader = new GeneratedClassLoader(
classFileFactory,
new URLClassLoader(new URL[]{ForTestCompileStdlib.stdlibJarForTests().toURI().toURL(), junitJar.toURI().toURL()},
TestCase.class.getClassLoader()));
JetTypeMapper typeMapper = new JetTypeMapper(classFileFactory.state.getStandardLibrary(), session.getMyBindingContext());
TestSuite suite = new TestSuite("StandardLibrary");