public void testDelegateToAnotherCodeSource() throws Exception
{
ClassLoaderSystem system = createClassLoaderSystemWithModifiedBootstrap();
MockClassLoaderPolicy pb = createMockClassLoaderPolicy("B");
pb.setPaths(ClassLoaderDomain.class);
ClassLoader b = system.registerClassLoaderPolicy(pb);
MockClassLoaderPolicy pa = createMockClassLoaderPolicy("A");
pa.setPaths(TestADelegateClassLoaderDomain.class);
pa.setDelegates(Collections.singletonList(new FilteredDelegateLoader(pb)));
ClassLoader a = system.registerClassLoaderPolicy(pa);
Class<?> fromB = assertLoadClass(ClassLoaderDomain.class, b, false);
Class<?> fromA = assertLoadClass(ClassLoaderDomain.class, a, b, false);