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.avalon;
27:
28: import org.apache.avalon.fortress.Container;
29: import org.jicarilla.container.Resolver;
30: import org.jicarilla.container.adapters.SingletonAdapter;
31: import org.jicarilla.container.factories.Type1Factory;
32: import org.jicarilla.container.factories.Type25Factory;
33: import org.jicarilla.container.factories.Type2Factory;
34: import org.jicarilla.container.factories.Type35Factory;
35: import org.jicarilla.container.integration.avalon.JicarillaBasedFortressContainer;
36: import org.jicarilla.container.selectors.HintedClassSelector;
37: import org.jicarilla.container.tck.components.interfaces.Bart;
38: import org.jicarilla.container.tck.components.interfaces.Homer;
39: import org.jicarilla.container.tck.components.interfaces.Lisa;
40: import org.jicarilla.container.tck.components.interfaces.Maggie;
41: import org.jicarilla.container.tck.components.interfaces.Marge;
42: import org.jicarilla.container.tck.components.interfaces.Script;
43: import org.jicarilla.container.tck.components.type1.avalon.AvalonBart;
44: import org.jicarilla.container.tck.components.type1.avalon.AvalonHomer;
45: import org.jicarilla.container.tck.components.type1.avalon.AvalonLisa;
46: import org.jicarilla.container.tck.components.type1.avalon.AvalonMaggie;
47: import org.jicarilla.container.tck.components.type1.avalon.AvalonMarge;
48: import org.jicarilla.container.tck.components.type3.rich.AllInTheFamilyScript;
49:
50: /**
51: *
52: *
53: * @author <a href="lsimons at jicarilla dot org">Leo Simons</a>
54: * @version $Id: JicarillaBasedAvalonAllInTheFamilyTestCase.java,v 1.2 2004/03/17 14:14:23 lsimons Exp $
55: */
56: public class JicarillaBasedAvalonAllInTheFamilyTestCase extends
57: AbstractAvalonAllInTheFamilyTestCase {
58: protected Container getContainer() {
59: JicarillaBasedFortressContainer jc = new JicarillaBasedFortressContainer();
60: doPopulate(jc);
61: return jc;
62: }
63:
64: protected void doPopulate(JicarillaBasedFortressContainer jc) {
65: Resolver r = jc.getResolver();
66: jc.registerAdapter(new HintedClassSelector(Marge.class),
67: new SingletonAdapter(new Type1Factory(r,
68: AvalonMarge.class.getName())));
69: jc.registerAdapter(new HintedClassSelector(Homer.class),
70: new SingletonAdapter(new Type25Factory(r,
71: AvalonHomer.class.getName())));
72: jc.registerAdapter(new HintedClassSelector(Bart.class),
73: new SingletonAdapter(new Type2Factory(r,
74: AvalonBart.class.getName())));
75: jc.registerAdapter(new HintedClassSelector(Lisa.class),
76: new SingletonAdapter(new Type1Factory(r,
77: AvalonLisa.class.getName())));
78: jc.registerAdapter(new HintedClassSelector(Maggie.class),
79: new SingletonAdapter(new Type2Factory(r,
80: AvalonMaggie.class.getName())));
81: jc.registerAdapter(new HintedClassSelector(Script.class),
82: new SingletonAdapter(new Type35Factory(r,
83: AllInTheFamilyScript.class.getName())));
84: }
85: }
|