KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > picocontainer > alternatives > EmptyPicoContainerTestCase


1 /*****************************************************************************
2  * Copyright (C) PicoContainer Organization. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  * *
8  * Original code by the committers *
9  *****************************************************************************/

10
11 package org.picocontainer.alternatives;
12
13 import junit.framework.TestCase;
14
15 import org.picocontainer.PicoContainer;
16
17 /**
18  * @author Mauro Talevi
19  * @version $Revision: $
20  */

21 public class EmptyPicoContainerTestCase extends TestCase {
22
23     public void testReturnValues() {
24         PicoContainer pico = new EmptyPicoContainer();
25         assertNull(pico.getComponentAdapter(null));
26         assertNull(pico.getComponentAdapterOfType(null));
27         assertTrue(pico.getComponentAdapters().isEmpty());
28         assertTrue(pico.getComponentAdaptersOfType(null).isEmpty());
29         assertNull(pico.getComponentInstance(null));
30         assertNull(pico.getComponentInstanceOfType(null));
31         assertTrue(pico.getComponentInstances().isEmpty());
32         assertTrue(pico.getComponentInstancesOfType(null).isEmpty());
33         assertNull(pico.getParent());
34     }
35
36     public void testVisitorAndLifecycleMethodsProduceNoResult() {
37         PicoContainer pico = new EmptyPicoContainer();
38         pico.verify();
39         pico.accept(null);
40         pico.start();
41         pico.stop();
42         pico.dispose();
43     }
44 }
45
Popular Tags