KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nanocontainer > script > AbstractScriptedContainerBuilderTestCase


1 /*****************************************************************************
2  * Copyright (C) NanoContainer 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 *
9  *****************************************************************************/

10 /**
11  * @author Aslak Hellesøy
12  * @version $Revision: 1629 $
13  */

14 package org.nanocontainer.script;
15
16 import org.jmock.MockObjectTestCase;
17 import org.picocontainer.PicoContainer;
18 import org.picocontainer.defaults.ObjectReference;
19 import org.picocontainer.defaults.SimpleReference;
20
21 public abstract class AbstractScriptedContainerBuilderTestCase extends MockObjectTestCase {
22     private ObjectReference containerRef = new SimpleReference();
23     private ObjectReference parentContainerRef = new SimpleReference();
24
25     protected PicoContainer buildContainer(ScriptedContainerBuilder builder, PicoContainer parentContainer, Object JavaDoc scope) {
26         parentContainerRef.set(parentContainer);
27         builder.buildContainer(containerRef, parentContainerRef, scope, true);
28         return (PicoContainer) containerRef.get();
29     }
30 }
Popular Tags