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 Aslak Hellesoy and Paul Hammant *
9 *****************************************************************************/
10
11 package org.picocontainer.defaults;
12
13 import org.picocontainer.PicoContainer;
14 import org.picocontainer.PicoIntrospectionException;
15 import org.picocontainer.PicoRegistrationException;
16 import org.picocontainer.tck.AbstractBasicStringCompatabilityTestCase;
17 import org.picocontainer.testmodel.DependsOnTouchable;
18 import org.picocontainer.testmodel.SimpleTouchable;
19
20 import java.util.HashMap;
21
22
23 public class DefaultPicoContainerStringKeyTestCase extends AbstractBasicStringCompatabilityTestCase {
24
25 public PicoContainer createPicoContainerWithTouchableAndDependency() throws DuplicateComponentKeyRegistrationException,
26 AssignabilityRegistrationException, NotConcreteRegistrationException, PicoIntrospectionException {
27
28 DefaultPicoContainer defaultPico = new DefaultPicoContainer.Default();
29 defaultPico.registerComponent("touchable", SimpleTouchable.class);
30 defaultPico.registerComponent("dependsOnTouchable", DependsOnTouchable.class);
31 return defaultPico;
32 }
33
34 public PicoContainer createPicoContainerWithTouchablesDependancyOnly() throws PicoRegistrationException, PicoIntrospectionException {
35 DefaultPicoContainer defaultPico = new DefaultPicoContainer.Default();
36 defaultPico.registerComponent("dependsOnTouchable", DependsOnTouchable.class);
37 return defaultPico;
38 }
39
40 protected void addAHashMapByInstance(PicoContainer picoContainer) throws PicoRegistrationException, PicoIntrospectionException {
41 ((DefaultPicoContainer) picoContainer).registerComponent("map", new HashMap());
42 }
43
44
45 // testXXX methods are in superclass.
46
47 }
This page was automatically generated by Maven