    001    /*****************************************************************************
    002     * Copyright (C) PicoContainer Organization. All rights reserved.            *
    003     * ------------------------------------------------------------------------- *
    004     * The software in this package is published under the terms of the BSD      *
    005     * style license a copy of which has been included with this distribution in *
    006     * the LICENSE.txt file.                                                     *
    007     *                                                                           *
    008     * Original code by the committers                                           *
    009     *****************************************************************************/
    010
    011    package org.picocontainer.containers;
    012
    013    import static org.junit.Assert.assertNull;
    014    import static org.junit.Assert.assertTrue;
    015
    016    import org.junit.Test;
    017    import org.picocontainer.NameBinding;
    018    import org.picocontainer.PicoContainer;
    019
    020    /**
    021     * @author Mauro Talevi
    022     */
    023    public class EmptyPicoContainerTestCase {
    024
    025        @Test public void testReturnValues() {
    026            PicoContainer pico = new EmptyPicoContainer();
    027            assertNull(pico.getComponentAdapter(null, (NameBinding) null));
    028            assertNull(pico.getComponentAdapter(null, (NameBinding) null));
    029            assertTrue(pico.getComponentAdapters().isEmpty());
    030            assertTrue(pico.getComponentAdapters(null).isEmpty());
    031            assertNull(pico.getComponent((Class) null));
    032            assertNull(pico.getComponent((Class) null));
    033            assertTrue(pico.getComponents().isEmpty());
    034            assertTrue(pico.getComponents(null).isEmpty());
    035            assertNull(pico.getParent());
    036        }
    037    }