01: /* ====================================================================
02: The Jicarilla Software License
03:
04: Copyright (c) 2003 Leo Simons.
05: All rights reserved.
06:
07: Permission is hereby granted, free of charge, to any person obtaining
08: a copy of this software and associated documentation files (the
09: "Software"), to deal in the Software without restriction, including
10: without limitation the rights to use, copy, modify, merge, publish,
11: distribute, sublicense, and/or sell copies of the Software, and to
12: permit persons to whom the Software is furnished to do so, subject to
13: the following conditions:
14:
15: The above copyright notice and this permission notice shall be
16: included in all copies or substantial portions of the Software.
17:
18: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21: IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22: CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23: TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24: SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25: ==================================================================== */
26: package org.jicarilla.container.test.integration.pico;
27:
28: import org.jicarilla.container.tck.AbstractAllInTheFamilyTestCase;
29: import org.jicarilla.container.tck.components.interfaces.Bart;
30: import org.jicarilla.container.tck.components.interfaces.Homer;
31: import org.jicarilla.container.tck.components.interfaces.Lisa;
32: import org.jicarilla.container.tck.components.interfaces.Maggie;
33: import org.jicarilla.container.tck.components.interfaces.Marge;
34: import org.jicarilla.container.tck.components.interfaces.Script;
35: import org.jicarilla.container.tck.components.type3.rich.AllInTheFamilyScript;
36: import org.jicarilla.container.tck.components.type3.rich.BartImpl;
37: import org.jicarilla.container.tck.components.type3.rich.HomerImpl;
38: import org.jicarilla.container.tck.components.type3.rich.LisaImpl;
39: import org.jicarilla.container.tck.components.type3.rich.MaggieImpl;
40: import org.jicarilla.container.tck.components.type3.rich.MargeImpl;
41: import org.picocontainer.MutablePicoContainer;
42:
43: /**
44: *
45: *
46: * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
47: * @version $Id: AbstractPicoAllInTheFamilyTestCase.java,v 1.2 2004/04/03 12:09:22 lsimons Exp $
48: */
49: public abstract class AbstractPicoAllInTheFamilyTestCase extends
50: AbstractAllInTheFamilyTestCase {
51: protected MutablePicoContainer pc;
52:
53: protected abstract MutablePicoContainer getContainer();
54:
55: public void setUp() throws Exception {
56: pc = getContainer();
57: doPopulate();
58: super .setUp();
59: }
60:
61: protected void doPopulate() {
62: pc.registerComponentImplementation(HomerImpl.class);
63: pc.registerComponentImplementation(MargeImpl.class);
64: pc.registerComponentImplementation(BartImpl.class);
65: pc.registerComponentImplementation(LisaImpl.class);
66: pc.registerComponentImplementation(MaggieImpl.class);
67: pc.registerComponentImplementation(AllInTheFamilyScript.class);
68: }
69:
70: protected Script getAllInTheFamilyScript() {
71: return (AllInTheFamilyScript) pc
72: .getComponentInstance(Script.class);
73: }
74:
75: protected Homer getHomer() {
76: return (Homer) pc.getComponentInstance(Homer.class);
77: }
78:
79: protected Marge getMarge() {
80: return (Marge) pc.getComponentInstance(Marge.class);
81: }
82:
83: protected Bart getBart() {
84: return (Bart) pc.getComponentInstance(Bart.class);
85: }
86:
87: protected Lisa getLisa() {
88: return (Lisa) pc.getComponentInstance(Lisa.class);
89: }
90:
91: protected Maggie getMaggie() {
92: return (Maggie) pc.getComponentInstance(Maggie.class);
93: }
94: }
|