KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > aop > dynaop > ContainerLoaderTestCase


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  * Idea by Rachel Davies, Original code by various *
9  *****************************************************************************/

10 package org.nanocontainer.aop.dynaop;
11
12 import junit.framework.TestCase;
13 import org.picocontainer.PicoContainer;
14 import org.picocontainer.PicoInitializationException;
15 import org.picocontainer.defaults.DefaultPicoContainer;
16
17 /**
18  * @author Stephen Molitor
19  */

20 public class ContainerLoaderTestCase extends TestCase {
21
22     private ContainerLoader loader = new ContainerLoader();
23     private PicoContainer container = new DefaultPicoContainer();
24
25     public void testContainerSet() {
26         loader.setContainer(container);
27         assertSame(container, loader.getContainer());
28     }
29
30     public void testContainerNotSet() {
31         try {
32             loader.getContainer();
33             fail("PicoInitializationException should have been raised");
34         } catch (PicoInitializationException e) {
35         }
36     }
37
38 }
Popular Tags