InternalModuleDefinitionSource source = new InternalModuleDefinitionSource(typeReaderRegistry, resolver, new String[]{"impala-core", "sample-module4", "sample-module6"});
RootModuleDefinition rootDefinition = source.getModuleDefinition();
DependencyManager dependencyManager = new DependencyManager(rootDefinition);
GraphClassLoaderFactory factory = new GraphClassLoaderFactory();
factory.setModuleLocationResolver(resolver);
GraphClassLoader rootClassLoader = factory.newClassLoader(classLoaderRegistry, dependencyManager, rootDefinition);
System.out.println(rootClassLoader);
String lineSeparator = System.getProperty("line.separator");
assertEquals("Class loader for impala-core" + lineSeparator +
"Options: ClassLoaderOptions [parentLoaderFirst=true, supportsModuleLibraries=true, exportsModuleLibraries=true, loadsModuleLibraryResources=true]" + lineSeparator, rootClassLoader.toString());
ModuleDefinition moduleDefinition6 = rootDefinition.findChildDefinition("sample-module6", true);
GraphClassLoader definition6Loader = factory.newClassLoader(classLoaderRegistry, dependencyManager, moduleDefinition6);
System.out.println(definition6Loader);
assertEquals(
"Class loader for sample-module6" + lineSeparator +
"Options: ClassLoaderOptions [parentLoaderFirst=true, supportsModuleLibraries=true, exportsModuleLibraries=true, loadsModuleLibraryResources=true]" + lineSeparator +