use of alice.util.JavaDynamicClassLoader in project narchy by automenta.
the class JavaDynamicClassLoaderTestCase method TestNestedPackage.
@Test
public void TestNestedPackage() throws ClassNotFoundException, IOException {
assertThrows(ClassNotFoundException.class, () -> {
JavaDynamicClassLoader loader = null;
File file = new File(".");
String tempPath = file.getCanonicalPath() + File.separator + "test" + File.separator + "unit" + File.separator + "TestURLClassLoaderNestedPackage.jar";
URL[] urls = getURLsFromStringArray(tempPath);
loader = new JavaDynamicClassLoader(urls, this.getClass().getClassLoader());
Class<?> cl = loader.loadClass("acme.corp.Counter");
assertNotNull(cl);
cl = loader.loadClass("java.lang.String");
assertNotNull(cl);
loader.removeAllURLs();
cl = loader.loadClass("Counter");
});
}