hello everyone,
consider the following classloader:
package org.foo;
public final class BytecodeClassLoader extends ClassLoader {
public Class loadClass( final byte[] bytecode ) {
final Class clazz = defineClass(null, bytecode, 0, bytecode.length);
return clazz;
}
}
given that
running a test like:
package org.foo;
public class BytecodeClassLoader extends TestCase {
public void testClass1Load() throws Exception {
final BytecodeClassLoader cl = new BytecodeClassLoader();
InputStream is = cl.getResourceAsStream("org/foo/Foo.class");
assertNotNull(is);
}
}
i get a java.io.IOException: Class not found
the class BytecodeClassLoader is in the src/test directory, and so it is the
LoadingClassTestCase. The same holds for the org/foo/Foo.java class.
Everything works fine within Eclipse.
I tried different combinations of forkMode/childDelegation, without success.
Any idea ?
thanks,
valerio
--
http://valerioschiavoni.blogspot.com
http://jroller.com/page/vschiavoni