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 *
009 *****************************************************************************/
010 package org.picocontainer.doc.tutorial.lifecycle;
011
012 import junit.framework.TestCase;
013 import org.picocontainer.MutablePicoContainer;
014 import org.picocontainer.DefaultPicoContainer;
015 import org.picocontainer.doc.tutorial.interfaces.Boy;
016
017 public class LifecycleTestCase extends TestCase {
018
019 public void testStartStopDispose() {
020 MutablePicoContainer pico = new DefaultPicoContainer();
021 pico.addComponent(Boy.class);
022 pico.addComponent(Girl.class);
023
024 // START SNIPPET: start
025 pico.start();
026 // END SNIPPET: start
027
028 // START SNIPPET: stopdispose
029 pico.stop();
030 pico.dispose();
031 // END SNIPPET: stopdispose
032 }
033
034
035 }