ApplicationClassLoader extends URLClassLoader { @Override public Class<?> loadClass(String name) throws ClassNotFoundException { return loadClass(name, false); } ApplicationClassLoader(ClassLoader parent, boolean entrust); @Override Class<?> loadClass(String name); @Override URL getResource(String name); synchronized void addFiles(Object... filePaths); synchronized void addJarFiles(String... jarFilePaths);  }
@Test public void testNodeClassLoader() throws ClassNotFoundException { ApplicationClassLoader applicationClassLoader = ApplicationClassLoaderFactory.getNodeApplicationClassLoader(); Assert.assertTrue(applicationClassLoader.loadClass("java.lang.String") == String.class); Assert.assertTrue(applicationClassLoader.loadClass("sun.text.resources.cldr.aa.FormatData_aa") == FormatData_aa.class); Assert.assertTrue(applicationClassLoader.loadClass("com.zuoxiaolong.niubi.job.scanner.ApplicationClassLoaderTest") == ApplicationClassLoaderTest.class); Assert.assertTrue(applicationClassLoader.loadClass("com.zuoxiaolong.niubi.job.core.exception.NiubiException") == NiubiException.class); }