@Test @IntegrationRule.Enforce public void testMultipleParentURL() throws Exception { ClassLoader classLoader = new MultipleParentClassLoader.Builder().append(first, second, null).build(); assertThat(classLoader.getResource(FOO), is(fooUrl)); assertThat(classLoader.getResource(BAR), is(barFirstUrl)); assertThat(classLoader.getResource(QUX), is(quxUrl)); verify(first).getResource(FOO); verify(first).getResource(BAR); verify(first).getResource(QUX); verifyNoMoreInteractions(first); verify(second).getResource(QUX); verifyNoMoreInteractions(second); }
public URL getResource(String name) { for (ClassLoader parent : parents) { URL url = parent.getResource(name); if (url != null) { return url; } } return super.getResource(name); }
MultipleParentClassLoader extends InjectionClassLoader { public URL getResource(String name) { for (ClassLoader parent : parents) { URL url = parent.getResource(name); if (url != null) { return url; } } return super.getResource(name); } }
MultipleParentClassLoader extends InjectionClassLoader { public URL getResource(String name) { for (ClassLoader parent : parents) { URL url = parent.getResource(name); if (url != null) { return url; } } return super.getResource(name); } MultipleParentClassLoader(List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents, boolean sealed); }
MultipleParentClassLoader extends InjectionClassLoader { public URL getResource(String name) { for (ClassLoader parent : parents) { URL url = parent.getResource(name); if (url != null) { return url; } } return super.getResource(name); } MultipleParentClassLoader(List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents, boolean sealed); URL getResource(String name); Enumeration<URL> getResources(String name); }
MultipleParentClassLoader extends InjectionClassLoader { public URL getResource(String name) { for (ClassLoader parent : parents) { URL url = parent.getResource(name); if (url != null) { return url; } } return super.getResource(name); } MultipleParentClassLoader(List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents);  MultipleParentClassLoader(ClassLoader parent, List<? extends ClassLoader> parents, boolean sealed); URL getResource(String name); Enumeration<URL> getResources(String name);  }