KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > doc > tutorial > lifecycle > LifecycleTestCase


1 package org.picocontainer.doc.tutorial.lifecycle;
2
3 import junit.framework.TestCase;
4 import org.picocontainer.MutablePicoContainer;
5 import org.picocontainer.defaults.DefaultPicoContainer;
6 import org.picocontainer.doc.tutorial.interfaces.Boy;
7
8 public class LifecycleTestCase extends TestCase {
9
10     public void testStartStopDispose() {
11         MutablePicoContainer pico = new DefaultPicoContainer();
12         pico.registerComponentImplementation(Boy.class);
13         pico.registerComponentImplementation(Girl.class);
14
15 // START SNIPPET: start
16
pico.start();
17 // END SNIPPET: start
18

19 // START SNIPPET: stopdispose
20
pico.stop();
21         pico.dispose();
22 // END SNIPPET: stopdispose
23
}
24
25
26 }
27
Popular Tags