assertNotNull("The testcomp.jar system property should point to java/nanocontainer/src/test-comp/TestComp.jar", testcompJarFileName);
File testCompJar = new File(testcompJarFileName);
// Set up parent
NanoContainer parentContainer = new DefaultNanoContainer();
parentContainer.addClassLoaderURL(testCompJar.toURL());
parentContainer.registerComponentImplementation("parentTestComp", "TestComp");
parentContainer.registerComponentImplementation("java.lang.StringBuffer");
PicoContainer parentContainerAdapterPico = parentContainer.getPico();
Object parentTestComp = parentContainerAdapterPico.getComponentInstance("parentTestComp");
assertEquals("TestComp", parentTestComp.getClass().getName());
// Set up child
NanoContainer childContainer = new DefaultNanoContainer(parentContainer);
File testCompJar2 = new File(testCompJar.getParentFile(), "TestComp2.jar");
childContainer.addClassLoaderURL(testCompJar2.toURL());
childContainer.registerComponentImplementation("childTestComp", "TestComp2");
PicoContainer childContainerAdapterPico = childContainer.getPico();
Object childTestComp = childContainerAdapterPico.getComponentInstance("childTestComp");
assertEquals("TestComp2", childTestComp.getClass().getName());
assertNotSame(parentTestComp, childTestComp);