Class<?> excludedClazz1 = appClassLoader.loadClass(TestBean.class.getName()); Class<?> excludedClazz2 = overridingClassLoader.loadClass(TestBean.class.getName()); Assert.assertTrue("TestBean will exclude from OverridingClassLoader, so no reload", excludedClazz1 == excludedClazz2);
Class<?> nonExcludedClazz1 = appClassLoader.loadClass(ITestBean.class.getName()); Class<?> nonExcludedClazz2 = overridingClassLoader.loadClass(ITestBean.class.getName()); Assert.assertFalse("ITestBean will not exclude, so reload again", nonExcludedClazz1 == nonExcludedClazz2); }