    001    package org.nanocontainer.script;
    002
    003    import java.util.HashMap;
    004    import java.util.Vector;
    005
    006    import junit.framework.Assert;
    007
    008    import org.picocontainer.ComponentAdapter;
    009    import org.picocontainer.MutablePicoContainer;
    010    import org.picocontainer.Parameter;
    011    import org.picocontainer.PicoRegistrationException;
    012    import org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer;
    013
    014    public class BarDecoratingPicoContainer extends AbstractDelegatingMutablePicoContainer {
    015        public BarDecoratingPicoContainer(MutablePicoContainer delegate) {
    016            super(delegate);
    017        }
    018
    019        public MutablePicoContainer makeChildContainer() {
    020            return null;
    021        }
    022
    023        public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoRegistrationException {
    024            Assert.assertEquals(Vector.class, componentImplementation);
    025            return super.registerComponentImplementation(HashMap.class, HashMap.class, parameters);
    026        }
    027
    028        public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException {
    029            Assert.assertEquals(Vector.class, componentImplementation);
    030            return super.registerComponentImplementation(HashMap.class, HashMap.class);
    031        }
    032
    033    }