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.alternatives;
012
013 import junit.framework.TestCase;
014
015 import org.picocontainer.PicoContainer;
016
017 /**
018 * @author Mauro Talevi
019 * @version $Revision: $
020 */
021 public class EmptyPicoContainerTestCase extends TestCase {
022
023 public void testReturnValues() {
024 PicoContainer pico = new EmptyPicoContainer();
025 assertNull(pico.getComponentAdapter(null));
026 assertNull(pico.getComponentAdapterOfType(null));
027 assertTrue(pico.getComponentAdapters().isEmpty());
028 assertTrue(pico.getComponentAdaptersOfType(null).isEmpty());
029 assertNull(pico.getComponentInstance(null));
030 assertNull(pico.getComponentInstanceOfType(null));
031 assertTrue(pico.getComponentInstances().isEmpty());
032 assertTrue(pico.getComponentInstancesOfType(null).isEmpty());
033 assertNull(pico.getParent());
034 }
035
036 public void testVisitorAndLifecycleMethodsProduceNoResult() {
037 PicoContainer pico = new EmptyPicoContainer();
038 pico.verify();
039 pico.accept(null);
040 pico.start();
041 pico.stop();
042 pico.dispose();
043 }
044 }