1 10 11 package org.nanocontainer.reflection; 12 13 import org.picocontainer.MutablePicoContainer; 14 import org.picocontainer.PicoContainer; 15 import org.picocontainer.tck.AbstractImplementationHidingPicoContainerTestCase; 16 import org.nanocontainer.NanoPicoContainer; 17 18 22 23 public class ImplementationHidingNanoPicoContainerTestCase extends AbstractImplementationHidingPicoContainerTestCase { 24 25 protected MutablePicoContainer createImplementationHidingPicoContainer() { 26 return new ImplementationHidingNanoPicoContainer(); 27 } 28 29 protected MutablePicoContainer createPicoContainer(PicoContainer parent) { 30 return new ImplementationHidingNanoPicoContainer(this.getClass().getClassLoader(), parent); 31 } 32 34 public void testMakeRemoveChildContainer() { 35 final NanoPicoContainer parent = (NanoPicoContainer) createPicoContainer(null); 36 parent.registerComponentInstance("java.lang.String", "This is a test"); 37 MutablePicoContainer pico = parent.makeChildContainer(); 38 assertNotNull(pico.getComponentInstance("java.lang.String")); 40 boolean result = parent.removeChildContainer(pico); 41 assertTrue(result); 42 } 43 44 } 45 | Popular Tags |