incubator-composer-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r614266 [4/4] - in /incubator/composer/trunk/composer-core/src: main/java/org/apache/composer/core/ main/java/org/apache/composer/core/containers/ main/java/org/apache/composer/core/visitors/ test/java/org/apache/composer/core/ test/java/or...
Date Tue, 22 Jan 2008 17:25:25 GMT
Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentAdapterTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentAdapterTest.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentAdapterTest.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentAdapterTest.java Tue Jan 22 09:25:16 2008
@@ -92,36 +92,36 @@
     /**
      * Prepare the test <em>verifyWithoutDependencyWorks</em>.
      * 
-     * @param picoContainer container, may probably not be used.
-     * @return a ComponentAdapter of the type to test for a component without dependencies. Registration in the pico is
+     * @param containerContainer container, may probably not be used.
+     * @return a ComponentAdapter of the type to test for a component without dependencies. Registration in the container is
      *         not necessary.
      */
-    protected abstract ComponentAdapter prepDEF_verifyWithoutDependencyWorks(MutableContainer picoContainer);
+    protected abstract ComponentAdapter prepDEF_verifyWithoutDependencyWorks(MutableContainer containerContainer);
 
     final @Test public void testDEF_verifyWithoutDependencyWorks() {
-        final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-        final ComponentAdapter componentAdapter = prepDEF_verifyWithoutDependencyWorks(picoContainer);
+        final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+        final ComponentAdapter componentAdapter = prepDEF_verifyWithoutDependencyWorks(containerContainer);
         assertSame(getComponentAdapterType(), componentAdapter.getClass());
-        componentAdapter.verify(picoContainer);
+        componentAdapter.verify(containerContainer);
     }
 
     /**
      * Prepare the test <em>verifyDoesNotInstantiate</em>.
      * 
-     * @param picoContainer container, may probably not be used.
+     * @param containerContainer container, may probably not be used.
      * @return a ComponentAdapter of the type to test for a component that may throw on instantiation. Registration in
-     *         the pico is not necessary.
+     *         the container is not necessary.
      */
-    protected abstract ComponentAdapter prepDEF_verifyDoesNotInstantiate(MutableContainer picoContainer);
+    protected abstract ComponentAdapter prepDEF_verifyDoesNotInstantiate(MutableContainer containerContainer);
 
     final @Test public void testDEF_verifyDoesNotInstantiate() {
-        final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-        final ComponentAdapter componentAdapter = prepDEF_verifyDoesNotInstantiate(picoContainer);
+        final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+        final ComponentAdapter componentAdapter = prepDEF_verifyDoesNotInstantiate(containerContainer);
         assertSame(getComponentAdapterType(), componentAdapter.getClass());
         final ComponentAdapter notInstantiatablecomponentAdapter = new NotInstantiatableBehavior(
                 componentAdapter);
         final Container wrappedContainer = wrapComponentInstances(
-                NotInstantiatableBehavior.class, picoContainer, null);
+                NotInstantiatableBehavior.class, containerContainer, null);
         notInstantiatablecomponentAdapter.verify(wrappedContainer);
     }
 
@@ -155,11 +155,11 @@
      * Prepare the test <em>isAbleToTakeParameters</em>. Overload this function, if the ComponentAdapter to test
      * supports {@link Parameter}.
      * 
-     * @param picoContainer container, may probably not be used.
+     * @param containerContainer container, may probably not be used.
      * @return a ComponentAdapter of the type to test. Select a component, that has some parameters. Registration in the
-     *         pico is not necessary.
+     *         container is not necessary.
      */
-    protected ComponentAdapter prepDEF_isAbleToTakeParameters(MutableContainer picoContainer) {
+    protected ComponentAdapter prepDEF_isAbleToTakeParameters(MutableContainer containerContainer) {
         final Class type = getComponentAdapterType();
         boolean hasParameters = supportsParameters(type);
         if (hasParameters) {
@@ -172,8 +172,8 @@
         final Class type = getComponentAdapterType();
         boolean hasParameters = supportsParameters(type);
         if (hasParameters) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepDEF_isAbleToTakeParameters(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepDEF_isAbleToTakeParameters(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
             final RecordingVisitor visitor = new RecordingVisitor();
             visitor.traverse(componentAdapter);
@@ -185,7 +185,7 @@
                 }
                 assertTrue("ComponentAdapter " + type + " supports parameters, provide some", hasParameters);
             }
-            final Object instance = componentAdapter.getComponentInstance(picoContainer);
+            final Object instance = componentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instance);
         }
     }
@@ -198,19 +198,19 @@
      * Prepare the test <em>isSerializable</em>. Overload this function, if the ComponentAdapter supports
      * serialization.
      * 
-     * @param picoContainer container, may probably not be used.
-     * @return a ComponentAdapter of the type to test. Registration in the pico is not necessary.
+     * @param containerContainer container, may probably not be used.
+     * @return a ComponentAdapter of the type to test. Registration in the container is not necessary.
      */
-    protected ComponentAdapter prepSER_isSerializable(MutableContainer picoContainer) {
+    protected ComponentAdapter prepSER_isSerializable(MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
     final @Test public void testSER_isSerializable() throws IOException, ClassNotFoundException {
         if ((getComponentAdapterNature() & SERIALIZABLE) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepSER_isSerializable(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepSER_isSerializable(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
-            final Object instance = componentAdapter.getComponentInstance(picoContainer);
+            final Object instance = componentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instance);
             final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
             final ObjectOutputStream outputStream = new ObjectOutputStream(byteArrayOutputStream);
@@ -221,7 +221,7 @@
             final ComponentAdapter serializedComponentAdapter = (ComponentAdapter)inputStream.readObject();
             inputStream.close();
             assertEquals(componentAdapter.getComponentKey(), serializedComponentAdapter.getComponentKey());
-            final Object instanceAfterSerialization = serializedComponentAdapter.getComponentInstance(picoContainer);
+            final Object instanceAfterSerialization = serializedComponentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instanceAfterSerialization);
             assertSame(instance.getClass(), instanceAfterSerialization.getClass());
         }
@@ -231,25 +231,25 @@
      * Prepare the test <em>isXStreamSerializable</em>. Overload this function, if the ComponentAdapter supports
      * serialization.
      * 
-     * @param picoContainer container, may probably not be used.
-     * @return a ComponentAdapter of the type to test. Registration in the pico is not necessary.
+     * @param containerContainer container, may probably not be used.
+     * @return a ComponentAdapter of the type to test. Registration in the container is not necessary.
      */
-    protected ComponentAdapter prepSER_isXStreamSerializable(MutableContainer picoContainer) {
+    protected ComponentAdapter prepSER_isXStreamSerializable(MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
     final @Test public void testSER_isXStreamSerializableWithPureReflection() {
         if ((getComponentAdapterNature() & SERIALIZABLE) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepSER_isXStreamSerializable(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepSER_isXStreamSerializable(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
-            final Object instance = componentAdapter.getComponentInstance(picoContainer);
+            final Object instance = componentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instance);
             final XStream xstream = new XStream(new PureJavaReflectionProvider(), new XppDriver());
             final String xml = xstream.toXML(componentAdapter);
             final ComponentAdapter serializedComponentAdapter = (ComponentAdapter)xstream.fromXML(xml);
             assertEquals(componentAdapter.getComponentKey(), serializedComponentAdapter.getComponentKey());
-            final Object instanceAfterSerialization = serializedComponentAdapter.getComponentInstance(picoContainer);
+            final Object instanceAfterSerialization = serializedComponentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instanceAfterSerialization);
             assertSame(instance.getClass(), instanceAfterSerialization.getClass());
         }
@@ -257,16 +257,16 @@
 
     final @Test public void testSER_isXStreamSerializable() {
         if ((getComponentAdapterNature() & SERIALIZABLE) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepSER_isXStreamSerializable(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepSER_isXStreamSerializable(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
-            final Object instance = componentAdapter.getComponentInstance(picoContainer);
+            final Object instance = componentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instance);
             final XStream xstream = new XStream(new XppDriver());
             final String xml = xstream.toXML(componentAdapter);
             final ComponentAdapter serializedComponentAdapter = (ComponentAdapter)xstream.fromXML(xml);
             assertEquals(componentAdapter.getComponentKey(), serializedComponentAdapter.getComponentKey());
-            final Object instanceAfterSerialization = serializedComponentAdapter.getComponentInstance(picoContainer);
+            final Object instanceAfterSerialization = serializedComponentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instanceAfterSerialization);
             assertSame(instance.getClass(), instanceAfterSerialization.getClass());
         }
@@ -280,32 +280,32 @@
      * Prepare the test <em>verificationFailsWithUnsatisfiedDependency</em>. Overload this function, if the
      * ComponentAdapter's verification can fail e.g. due to an unresolved dependency.
      * 
-     * @param picoContainer container, may probably not be used.
+     * @param containerContainer container, may probably not be used.
      * @return a ComponentAdapter of the type to test, that fails for the verification, e.g. because of a compoennt with
-     *         missing dependencies. Registration in the pico is not necessary.
+     *         missing dependencies. Registration in the container is not necessary.
      */
-    protected ComponentAdapter prepVER_verificationFails(MutableContainer picoContainer) {
+    protected ComponentAdapter prepVER_verificationFails(MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
     final @Test public void testVER_verificationFails() {
         if ((getComponentAdapterNature() & VERIFYING) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer();
-            final ComponentAdapter componentAdapter = prepVER_verificationFails(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer();
+            final ComponentAdapter componentAdapter = prepVER_verificationFails(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
             try {
-                componentAdapter.verify(picoContainer);
-                fail("PicoCompositionException expected");
+                componentAdapter.verify(containerContainer);
+                fail("ContainerCompositionException expected");
             } catch (CompositionException e) {
             } catch (Exception e) {
-                fail("PicoCompositionException expected, but got " + e.getClass().getName());
+                fail("ContainerCompositionException expected, but got " + e.getClass().getName());
             }
             try {
-                componentAdapter.getComponentInstance(picoContainer);
-                fail("PicoCompositionException or PicoCompositionException expected");
+                componentAdapter.getComponentInstance(containerContainer);
+                fail("ContainerCompositionException or ContainerCompositionException expected");
             } catch (CompositionException e) {
             } catch (Exception e) {
-                fail("PicoCompositionException or PicoCompositionException expected, but got "
+                fail("ContainerCompositionException or ContainerCompositionException expected, but got "
                         + e.getClass().getName());
             }
         }
@@ -319,43 +319,43 @@
      * Prepare the test <em>createsNewInstances</em>. Overload this function, if the ComponentAdapter is
      * instantiating. It should create a new instance with every call.
      * 
-     * @param picoContainer container, may probably not be used.
-     * @return a ComponentAdapter of the type to test. Registration in the pico is not necessary.
+     * @param containerContainer container, may probably not be used.
+     * @return a ComponentAdapter of the type to test. Registration in the container is not necessary.
      */
-    protected ComponentAdapter prepINS_createsNewInstances(MutableContainer picoContainer) {
+    protected ComponentAdapter prepINS_createsNewInstances(MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
     final @Test public void testINS_createsNewInstances() {
         if ((getComponentAdapterNature() & INSTANTIATING) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepINS_createsNewInstances(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepINS_createsNewInstances(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
-            final Object instance = componentAdapter.getComponentInstance(picoContainer);
+            final Object instance = componentAdapter.getComponentInstance(containerContainer);
             assertNotNull(instance);
-            assertNotSame(instance, componentAdapter.getComponentInstance(picoContainer));
-            assertSame(instance.getClass(), componentAdapter.getComponentInstance(picoContainer).getClass());
+            assertNotSame(instance, componentAdapter.getComponentInstance(containerContainer));
+            assertSame(instance.getClass(), componentAdapter.getComponentInstance(containerContainer).getClass());
         }
     }
 
     /**
      * Prepare the test <em>errorIsRethrown</em>. Overload this function, if the ComponentAdapter is instantiating.
      * 
-     * @param picoContainer container, may probably not be used.
+     * @param containerContainer container, may probably not be used.
      * @return a ComponentAdapter of the type to test with a component that fails with an {@link Error} at
-     *         instantiation. Registration in the pico is not necessary.
+     *         instantiation. Registration in the container is not necessary.
      */
-    protected ComponentAdapter prepINS_errorIsRethrown(MutableContainer picoContainer) {
+    protected ComponentAdapter prepINS_errorIsRethrown(MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
     final @Test public void testINS_errorIsRethrown() {
         if ((getComponentAdapterNature() & INSTANTIATING) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepINS_errorIsRethrown(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepINS_errorIsRethrown(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
             try {
-                componentAdapter.getComponentInstance(picoContainer);
+                componentAdapter.getComponentInstance(containerContainer);
                 fail("Thrown Error excpected");
             } catch (final Error e) {
                 assertEquals("test", e.getMessage());
@@ -367,21 +367,21 @@
      * Prepare the test <em>runtimeExceptionIsRethrown</em>. Overload this function, if the ComponentAdapter is
      * instantiating.
      * 
-     * @param picoContainer container, may probably not be used.
+     * @param containerContainer container, may probably not be used.
      * @return a ComponentAdapter of the type to test with a component that fails with a {@link RuntimeException} at
-     *         instantiation. Registration in the pico is not necessary.
+     *         instantiation. Registration in the container is not necessary.
      */
-    protected ComponentAdapter prepINS_runtimeExceptionIsRethrown(MutableContainer picoContainer) {
+    protected ComponentAdapter prepINS_runtimeExceptionIsRethrown(MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
     final @Test public void testINS_runtimeExceptionIsRethrown() {
         if ((getComponentAdapterNature() & INSTANTIATING) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepINS_runtimeExceptionIsRethrown(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepINS_runtimeExceptionIsRethrown(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
             try {
-                componentAdapter.getComponentInstance(picoContainer);
+                componentAdapter.getComponentInstance(containerContainer);
                 fail("Thrown RuntimeException excpected");
             } catch (final RuntimeException e) {
                 assertEquals("test", e.getMessage());
@@ -390,27 +390,27 @@
     }
 
     /**
-     * Prepare the test <em>normalExceptionIsRethrownInsidePicoInvocationTargetInitializationException</em>. Overload
+     * Prepare the test <em>normalExceptionIsRethrownInsideContainerInvocationTargetInitializationException</em>. Overload
      * this function, if the ComponentAdapter is instantiating.
      * 
-     * @param picoContainer container, may probably not be used.
+     * @param containerContainer container, may probably not be used.
      * @return a ComponentAdapter of the type to test with a component that fails with a
-     *         {@link org.apache.composer.core.CompositionException} at instantiation. Registration in the pico is not
+     *         {@link org.apache.composer.core.CompositionException} at instantiation. Registration in the container is not
      *         necessary.
      */
     protected ComponentAdapter prepINS_normalExceptionIsRethrownInsideInitializationException(
-            MutableContainer picoContainer) {
+            MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
-    final @Test public void testINS_normalExceptionIsRethrownInsidePicoInitializationException() {
+    final @Test public void testINS_normalExceptionIsRethrownInsideContainerInitializationException() {
         if ((getComponentAdapterNature() & INSTANTIATING) > 0) {
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepINS_normalExceptionIsRethrownInsideInitializationException(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepINS_normalExceptionIsRethrownInsideInitializationException(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
             try {
-                componentAdapter.getComponentInstance(picoContainer);
-                fail("Thrown PicoCompositionException excpected");
+                componentAdapter.getComponentInstance(containerContainer);
+                fail("Thrown ContainerCompositionException excpected");
             } catch (final CompositionException e) {
                 assertTrue(e.getCause() instanceof Exception);
                 assertTrue(e.getCause().getMessage().endsWith("test"));
@@ -426,11 +426,11 @@
      * Prepare the test <em>dependenciesAreResolved</em>. Overload this function, if the ComponentAdapter is resolves
      * dependencies.
      * 
-     * @param picoContainer container, used to register dependencies.
-     * @return a ComponentAdapter of the type to test with a component that has dependencies. Registration in the pico
+     * @param containerContainer container, used to register dependencies.
+     * @return a ComponentAdapter of the type to test with a component that has dependencies. Registration in the container
      *         is not necessary.
      */
-    protected ComponentAdapter prepRES_dependenciesAreResolved(MutableContainer picoContainer) {
+    protected ComponentAdapter prepRES_dependenciesAreResolved(MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
@@ -438,12 +438,12 @@
         if ((getComponentAdapterNature() & RESOLVING) > 0) {
             final List dependencies = new LinkedList();
             final Object[] wrapperDependencies = new Object[]{dependencies};
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepRES_dependenciesAreResolved(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepRES_dependenciesAreResolved(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
-            assertFalse(picoContainer.getComponentAdapters().contains(componentAdapter));
+            assertFalse(containerContainer.getComponentAdapters().contains(componentAdapter));
             final Container wrappedContainer = wrapComponentInstances(
-                    CollectingBehavior.class, picoContainer, wrapperDependencies);
+                    CollectingBehavior.class, containerContainer, wrapperDependencies);
             final Object instance = componentAdapter.getComponentInstance(wrappedContainer);
             assertNotNull(instance);
             assertTrue(dependencies.size() > 0);
@@ -454,12 +454,12 @@
      * Prepare the test <em>failingVerificationWithCyclicDependencyException</em>. Overload this function, if the
      * ComponentAdapter is resolves dependencies.
      * 
-     * @param picoContainer container, used to register dependencies.
+     * @param containerContainer container, used to register dependencies.
      * @return a ComponentAdapter of the type to test with a component that has cyclic dependencies. You have to
-     *         register the component itself in the pico.
+     *         register the component itself in the container.
      */
     protected ComponentAdapter prepRES_failingVerificationWithCyclicDependencyException(
-            MutableContainer picoContainer) {
+            MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
@@ -468,15 +468,15 @@
             final Set cycleInstances = new HashSet();
             final ObjectReference cycleCheck = new SimpleReference();
             final Object[] wrapperDependencies = new Object[]{cycleInstances, cycleCheck};
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepRES_failingVerificationWithCyclicDependencyException(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepRES_failingVerificationWithCyclicDependencyException(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
-            assertTrue(picoContainer.getComponentAdapters().contains(componentAdapter));
+            assertTrue(containerContainer.getComponentAdapters().contains(componentAdapter));
             final Container wrappedContainer = wrapComponentInstances(
-                    CycleDetectorBehavior.class, picoContainer, wrapperDependencies);
+                    CycleDetectorBehavior.class, containerContainer, wrapperDependencies);
             try {
                 componentAdapter.verify(wrappedContainer);
-                fail("Thrown PicoVerificationException excpected");
+                fail("Thrown ContainerVerificationException excpected");
             } catch (final AbstractInjector.CyclicDependencyException cycle) {
                 final Class[] dependencies = cycle.getDependencies();
                 assertSame(dependencies[0], dependencies[dependencies.length - 1]);
@@ -488,12 +488,12 @@
      * Prepare the test <em>failingInstantiationWithCyclicDependencyException</em>. Overload this function, if the
      * ComponentAdapter is resolves dependencies.
      * 
-     * @param picoContainer container, used to register dependencies.
+     * @param containerContainer container, used to register dependencies.
      * @return a ComponentAdapter of the type to test with a component that has cyclic dependencies. You have to
-     *         register the component itself in the pico.
+     *         register the component itself in the container.
      */
     protected ComponentAdapter prepRES_failingInstantiationWithCyclicDependencyException(
-            MutableContainer picoContainer) {
+            MutableContainer containerContainer) {
         throw new AssertionFailedError("You have to overwrite this method for a useful test");
     }
 
@@ -502,12 +502,12 @@
             final Set cycleInstances = new HashSet();
             final ObjectReference cycleCheck = new SimpleReference();
             final Object[] wrapperDependencies = new Object[]{cycleInstances, cycleCheck};
-            final MutableContainer picoContainer = new DefaultContainer(createDefaultComponentFactory());
-            final ComponentAdapter componentAdapter = prepRES_failingInstantiationWithCyclicDependencyException(picoContainer);
+            final MutableContainer containerContainer = new DefaultContainer(createDefaultComponentFactory());
+            final ComponentAdapter componentAdapter = prepRES_failingInstantiationWithCyclicDependencyException(containerContainer);
             assertSame(getComponentAdapterType(), componentAdapter.getClass());
-            assertTrue(picoContainer.getComponentAdapters().contains(componentAdapter));
+            assertTrue(containerContainer.getComponentAdapters().contains(componentAdapter));
             final Container wrappedContainer = wrapComponentInstances(
-                    CycleDetectorBehavior.class, picoContainer, wrapperDependencies);
+                    CycleDetectorBehavior.class, containerContainer, wrapperDependencies);
             try {
                 componentAdapter.getComponentInstance(wrappedContainer);
                 fail("Thrown CyclicDependencyException excpected");
@@ -525,8 +525,8 @@
     static class RecordingVisitor extends AbstractContainerVisitor {
         private final List visitedElements = new LinkedList();
 
-        public void visitContainer(Container pico) {
-            visitedElements.add(pico);
+        public void visitContainer(Container container) {
+            visitedElements.add(container);
         }
 
         public void visitComponentAdapter(ComponentAdapter componentAdapter) {
@@ -630,12 +630,12 @@
     }
 
     final protected Container wrapComponentInstances(
-            final Class decoratingComponentAdapterClass, final Container picoContainer,
+            final Class decoratingComponentAdapterClass, final Container containerContainer,
             final Object[] wrapperDependencies) {
         assertTrue(AbstractBehavior.class.isAssignableFrom(decoratingComponentAdapterClass));
         final MutableContainer mutableContainer = new DefaultContainer();
         final int size = (wrapperDependencies != null ? wrapperDependencies.length : 0) + 1;
-        final Collection allComponentAdapters = picoContainer.getComponentAdapters();
+        final Collection allComponentAdapters = containerContainer.getComponentAdapters();
         for (Object allComponentAdapter : allComponentAdapters) {
             final Parameter[] parameters = new Parameter[size];
             parameters[0] = new ConstantParameter(allComponentAdapter);

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentFactoryTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentFactoryTest.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentFactoryTest.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractComponentFactoryTest.java Tue Jan 22 09:25:16 2008
@@ -40,13 +40,13 @@
  */
 public abstract class AbstractComponentFactoryTest {
 
-    protected DefaultContainer picoContainer;
+    protected DefaultContainer containerContainer;
 
     protected abstract ComponentFactory createComponentFactory();
 
     @Before
     public void setUp() throws Exception {
-        picoContainer = new DefaultContainer();
+        containerContainer = new DefaultContainer();
     }
 
     @Test public void testEquals() throws CompositionException {
@@ -71,9 +71,9 @@
                                                             Touchable.class,
                                                             SimpleTouchable.class);
 
-        picoContainer.addAdapter(componentAdapter);
+        containerContainer.addAdapter(componentAdapter);
 
-        ComponentAdapter adapter = (ComponentAdapter)picoContainer.getComponentAdapters().toArray()[0];
+        ComponentAdapter adapter = (ComponentAdapter)containerContainer.getComponentAdapters().toArray()[0];
         assertSame(componentAdapter.getComponentKey(), adapter.getComponentKey());
     }
 
@@ -86,9 +86,9 @@
                                                             Touchable.class,
                                                             SimpleTouchable.class);
 
-        picoContainer.addAdapter(componentAdapter);
-        picoContainer.removeComponent(Touchable.class);
+        containerContainer.addAdapter(componentAdapter);
+        containerContainer.removeComponent(Touchable.class);
 
-        assertFalse(picoContainer.getComponentAdapters().contains(componentAdapter));
+        assertFalse(containerContainer.getComponentAdapters().contains(componentAdapter));
     }
 }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractContainerTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractContainerTest.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractContainerTest.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractContainerTest.java Tue Jan 22 09:25:16 2008
@@ -79,41 +79,41 @@
     protected abstract MutableContainer createContainer(Container parent);
 
     protected final MutableContainer createContainerWithDependsOnTouchableOnly() throws CompositionException {
-        MutableContainer pico = createContainer(null);
-        pico.addComponent(DependsOnTouchable.class);
-        return pico;
+        MutableContainer container = createContainer(null);
+        container.addComponent(DependsOnTouchable.class);
+        return container;
     }
 
     protected final MutableContainer createContainerWithTouchableAndDependsOnTouchable() throws CompositionException {
-        MutableContainer pico = createContainerWithDependsOnTouchableOnly();
-        pico.as(Characteristics.CACHE).addComponent(Touchable.class, SimpleTouchable.class);
-        return pico;
+        MutableContainer container = createContainerWithDependsOnTouchableOnly();
+        container.as(Characteristics.CACHE).addComponent(Touchable.class, SimpleTouchable.class);
+        return container;
     }
 
     @Test public void testBasicInstantiationAndContainment() throws ComposerException {
-        Container pico = createContainerWithTouchableAndDependsOnTouchable();
+        Container container = createContainerWithTouchableAndDependsOnTouchable();
         assertTrue("Component should be instance of Touchable",
-                   Touchable.class.isAssignableFrom(pico.getComponentAdapter(Touchable.class, (NameBinding) null).getComponentImplementation()));
+                   Touchable.class.isAssignableFrom(container.getComponentAdapter(Touchable.class, (NameBinding) null).getComponentImplementation()));
     }
 
     @Test public void testRegisteredComponentsExistAndAreTheCorrectTypes() throws ComposerException {
-        Container pico = createContainerWithTouchableAndDependsOnTouchable();
+        Container container = createContainerWithTouchableAndDependsOnTouchable();
         assertNotNull("Container should have Touchable addComponent",
-                      pico.getComponentAdapter(Touchable.class, (NameBinding) null));
+                      container.getComponentAdapter(Touchable.class, (NameBinding) null));
         assertNotNull("Container should have DependsOnTouchable addComponent",
-                      pico.getComponentAdapter(DependsOnTouchable.class, (NameBinding) null));
+                      container.getComponentAdapter(DependsOnTouchable.class, (NameBinding) null));
         assertTrue("Component should be instance of Touchable",
-                   pico.getComponent(Touchable.class) != null);
+                   container.getComponent(Touchable.class) != null);
         assertTrue("Component should be instance of DependsOnTouchable",
-                   pico.getComponent(DependsOnTouchable.class) != null);
-        assertNull("should not have non existent addComponent", pico.getComponentAdapter(Map.class, (NameBinding) null));
+                   container.getComponent(DependsOnTouchable.class) != null);
+        assertNull("should not have non existent addComponent", container.getComponentAdapter(Map.class, (NameBinding) null));
     }
 
     @Test public void testRegistersSingleInstance() throws ComposerException {
-        MutableContainer pico = createContainer(null);
+        MutableContainer container = createContainer(null);
         StringBuffer sb = new StringBuffer();
-        pico.addComponent(sb);
-        assertSame(sb, pico.getComponent(StringBuffer.class));
+        container.addComponent(sb);
+        assertSame(sb, container.getComponent(StringBuffer.class));
     }
 
     @Test public void testContainerIsSerializable() throws ComposerException,
@@ -125,21 +125,21 @@
     }
 
     private Touchable getTouchableFromSerializedContainer() throws IOException, ClassNotFoundException {
-        MutableContainer pico = createContainerWithTouchableAndDependsOnTouchable();
+        MutableContainer container = createContainerWithTouchableAndDependsOnTouchable();
         // Add a list too, using a constant parameter
-        pico.addComponent("list", ArrayList.class, new ConstantParameter(10));
+        container.addComponent("list", ArrayList.class, new ConstantParameter(10));
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         ObjectOutputStream oos = new ObjectOutputStream(baos);
 
-        oos.writeObject(pico);
+        oos.writeObject(container);
         ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray()));
 
-        pico = (MutableContainer)ois.readObject();
+        container = (MutableContainer)ois.readObject();
 
-        DependsOnTouchable dependsOnTouchable = pico.getComponent(DependsOnTouchable.class);
+        DependsOnTouchable dependsOnTouchable = container.getComponent(DependsOnTouchable.class);
         assertNotNull(dependsOnTouchable);
-        return pico.getComponent(Touchable.class);
+        return container.getComponent(Touchable.class);
     }
 
     @Test public void testSerializedContainerCanRetrieveImplementation() throws ComposerException,
@@ -155,12 +155,12 @@
 
 
     @Test public void testGettingComponentWithMissingDependencyFails() throws ComposerException {
-        Container picoContainer = createContainerWithDependsOnTouchableOnly();
+        Container containerContainer = createContainerWithDependsOnTouchableOnly();
         try {
-            picoContainer.getComponent(DependsOnTouchable.class);
+            containerContainer.getComponent(DependsOnTouchable.class);
             fail("should need a Touchable");
         } catch (AbstractInjector.UnsatisfiableDependenciesException e) {
-            assertSame(picoContainer.getComponentAdapter(DependsOnTouchable.class, (NameBinding) null).getComponentImplementation(),
+            assertSame(containerContainer.getComponentAdapter(DependsOnTouchable.class, (NameBinding) null).getComponentImplementation(),
                        e.getUnsatisfiableComponentAdapter().getComponentImplementation());
             final Set unsatisfiableDependencies = e.getUnsatisfiableDependencies();
             assertEquals(1, unsatisfiableDependencies.size());
@@ -174,9 +174,9 @@
 
     @Test public void testDuplicateRegistration() {
         try {
-            MutableContainer pico = createContainer(null);
-            pico.addComponent(Object.class);
-            pico.addComponent(Object.class);
+            MutableContainer container = createContainer(null);
+            container.addComponent(Object.class);
+            container.addComponent(Object.class);
             fail("Should have failed with duplicate registration");
         } catch (CompositionException e) {
             assertTrue("Wrong key", e.getMessage().indexOf(Object.class.toString()) > -1);
@@ -184,31 +184,31 @@
     }
 
     @Test public void testExternallyInstantiatedObjectsCanBeRegisteredAndLookedUp() throws ComposerException {
-        MutableContainer pico = createContainer(null);
+        MutableContainer container = createContainer(null);
         final HashMap map = new HashMap();
-        pico.as(getProperties()).addComponent(Map.class, map);
-        assertSame(map, pico.getComponent(Map.class));
+        container.as(getProperties()).addComponent(Map.class, map);
+        assertSame(map, container.getComponent(Map.class));
     }
 
     @Test public void testAmbiguousResolution() throws CompositionException {
-        MutableContainer pico = createContainer(null);
-        pico.addComponent("ping", String.class);
-        pico.addComponent("pong", "pang");
+        MutableContainer container = createContainer(null);
+        container.addComponent("ping", String.class);
+        container.addComponent("pong", "pang");
         try {
-            pico.getComponent(String.class);
+            container.getComponent(String.class);
         } catch (AbstractInjector.AmbiguousComponentResolutionException e) {
             assertTrue(e.getMessage().indexOf("java.lang.String") != -1);
         }
     }
 
     @Test public void testLookupWithUnregisteredKeyReturnsNull() throws CompositionException {
-        MutableContainer pico = createContainer(null);
-        assertNull(pico.getComponent(String.class));
+        MutableContainer container = createContainer(null);
+        assertNull(container.getComponent(String.class));
     }
 
     @Test public void testLookupWithUnregisteredTypeReturnsNull() throws CompositionException {
-        MutableContainer pico = createContainer(null);
-        assertNull(pico.getComponent(String.class));
+        MutableContainer container = createContainer(null);
+        assertNull(container.getComponent(String.class));
     }
 
     public static class ListAdder {
@@ -218,11 +218,11 @@
     }
 
     @Test public void testUnsatisfiableDependenciesExceptionGivesVerboseEnoughErrorMessage() {
-        MutableContainer pico = createContainer(null);
-        pico.addComponent(ComponentD.class);
+        MutableContainer container = createContainer(null);
+        container.addComponent(ComponentD.class);
 
         try {
-            pico.getComponent(ComponentD.class);
+            container.getComponent(ComponentD.class);
         } catch (AbstractInjector.UnsatisfiableDependenciesException e) {
             Set unsatisfiableDependencies = e.getUnsatisfiableDependencies();
             assertEquals(1, unsatisfiableDependencies.size());
@@ -238,14 +238,14 @@
     }
 
     @Test public void testUnsatisfiableDependenciesExceptionGivesUnsatisfiedDependencyTypes() {
-        MutableContainer pico = createContainer(null);
+        MutableContainer container = createContainer(null);
         // D depends on E and B
-        pico.addComponent(ComponentD.class);
+        container.addComponent(ComponentD.class);
 
         // first - do not register any dependency
         // should yield first unsatisfied dependency
         try {
-            pico.getComponent(ComponentD.class);
+            container.getComponent(ComponentD.class);
         } catch (AbstractInjector.UnsatisfiableDependenciesException e) {
             Set unsatisfiableDependencies = e.getUnsatisfiableDependencies();
             assertEquals(1, unsatisfiableDependencies.size());
@@ -262,9 +262,9 @@
 
         // now register only first dependency
         // should yield second unsatisfied dependency
-        pico.addComponent(ComponentE.class);
+        container.addComponent(ComponentE.class);
         try {
-            pico.getComponent(ComponentD.class);
+            container.getComponent(ComponentD.class);
         } catch (AbstractInjector.UnsatisfiableDependenciesException e) {
             Set unsatisfiableDependencies = e.getUnsatisfiableDependencies();
             assertEquals(1, unsatisfiableDependencies.size());
@@ -284,13 +284,13 @@
         assertCyclicDependencyThrowsCyclicDependencyException(createContainer(null));
     }
 
-    private static void assertCyclicDependencyThrowsCyclicDependencyException(MutableContainer pico) {
-        pico.addComponent(ComponentB.class);
-        pico.addComponent(ComponentD.class);
-        pico.addComponent(ComponentE.class);
+    private static void assertCyclicDependencyThrowsCyclicDependencyException(MutableContainer container) {
+        container.addComponent(ComponentB.class);
+        container.addComponent(ComponentD.class);
+        container.addComponent(ComponentE.class);
 
         try {
-            pico.getComponent(ComponentD.class);
+            container.getComponent(ComponentD.class);
             fail("CyclicDependencyException expected");
         } catch (AbstractInjector.CyclicDependencyException e) {
             // CyclicDependencyException reports now the stack.
@@ -304,13 +304,13 @@
     }
 
     @Test public void testCyclicDependencyThrowsCyclicDependencyExceptionWithParentContainer() {
-        MutableContainer pico = createContainer(createContainer(null));
-        assertCyclicDependencyThrowsCyclicDependencyException(pico);
+        MutableContainer container = createContainer(createContainer(null));
+        assertCyclicDependencyThrowsCyclicDependencyException(container);
     }
 
     @Test public void testRemovalNonRegisteredComponentAdapterWorksAndReturnsNull() {
-        final MutableContainer picoContainer = createContainer(null);
-        assertNull(picoContainer.removeComponent("COMPONENT DOES NOT EXIST"));
+        final MutableContainer containerContainer = createContainer(null);
+        assertNull(containerContainer.removeComponent("COMPONENT DOES NOT EXIST"));
     }
 
     /** Important! Nanning really, really depends on this! */
@@ -319,19 +319,19 @@
         ConstructorInjector c1 = new ConstructorInjector("1", Object.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false);
         ConstructorInjector c2 = new ConstructorInjector("2", String.class, null, new NullComponentMonitor(), new NullLifecycleStrategy(), false);
 
-        MutableContainer picoContainer = createContainer(null);
-        picoContainer.addAdapter(c1).addAdapter(c2);
-        Collection<ComponentAdapter<?>> list2 = picoContainer.getComponentAdapters();
+        MutableContainer containerContainer = createContainer(null);
+        containerContainer.addAdapter(c1).addAdapter(c2);
+        Collection<ComponentAdapter<?>> list2 = containerContainer.getComponentAdapters();
         //registration order should be maintained
         assertEquals(2, list2.size());
         assertEquals(c1.getComponentKey(), ((ComponentAdapter)list2.toArray()[0]).getComponentKey());
         assertEquals(c2.getComponentKey(), ((ComponentAdapter)list2.toArray()[1]).getComponentKey());
 
-        picoContainer.getComponents(); // create all the instances at once
+        containerContainer.getComponents(); // create all the instances at once
         assertFalse("instances should be created in same order as adapters are created",
-                    picoContainer.getComponents().get(0) instanceof String);
+                    containerContainer.getComponents().get(0) instanceof String);
         assertTrue("instances should be created in same order as adapters are created",
-                   picoContainer.getComponents().get(1) instanceof String);
+                   containerContainer.getComponents().get(1) instanceof String);
 
         MutableContainer reversedContainer = createContainer(null);
         reversedContainer.addAdapter(c2);
@@ -366,21 +366,21 @@
     }
 
     @Test public void testSameInstanceCanBeUsedAsDifferentTypeWhenCaching() {
-        MutableContainer pico = createContainer(null);
-        pico.as(Characteristics.CACHE).addComponent("wt", WashableTouchable.class);
-        pico.addComponent("nw", NeedsWashable.class);
-        pico.as(Characteristics.CACHE).addComponent("nt", NeedsTouchable.class);
+        MutableContainer container = createContainer(null);
+        container.as(Characteristics.CACHE).addComponent("wt", WashableTouchable.class);
+        container.addComponent("nw", NeedsWashable.class);
+        container.as(Characteristics.CACHE).addComponent("nt", NeedsTouchable.class);
 
-        NeedsWashable nw = (NeedsWashable)pico.getComponent("nw");
-        NeedsTouchable nt = (NeedsTouchable)pico.getComponent("nt");
+        NeedsWashable nw = (NeedsWashable)container.getComponent("nw");
+        NeedsTouchable nt = (NeedsTouchable)container.getComponent("nt");
         assertSame(nw.washable, nt.touchable);
     }
 
     @Test public void testRegisterComponentWithObjectBadType() throws CompositionException {
-        MutableContainer pico = createContainer(null);
+        MutableContainer container = createContainer(null);
 
         try {
-            pico.addComponent(Serializable.class, new Object());
+            container.addComponent(Serializable.class, new Object());
             fail("Shouldn't be able to register an Object.class as Serializable because it is not, " +
                  "it does not implement it, Object.class does not implement much.");
         } catch (ClassCastException e) {
@@ -398,12 +398,12 @@
         }
     }
 
-    // http://jira.codehaus.org/secure/ViewIssue.jspa?key=PICO-52
-    @Test public void testPico52() {
-        MutableContainer pico = createContainer(null);
+    // PICO-52
+    @Test public void testContainer52() {
+        MutableContainer container = createContainer(null);
 
-        pico.addComponent("foo", JMSService.class, new ConstantParameter("0"), new ConstantParameter("something"));
-        JMSService jms = (JMSService)pico.getComponent("foo");
+        container.addComponent("foo", JMSService.class, new ConstantParameter("0"), new ConstantParameter("something"));
+        JMSService jms = (JMSService)container.getComponent("foo");
         assertEquals("0", jms.serverid);
         assertEquals("something", jms.path);
     }
@@ -444,12 +444,12 @@
     }
 
     @Test public void testAggregatedVerificationException() {
-        MutableContainer pico = createContainer(null);
-        pico.addComponent(ComponentA.class);
-        pico.addComponent(ComponentE.class);
+        MutableContainer container = createContainer(null);
+        container.addComponent(ComponentA.class);
+        container.addComponent(ComponentE.class);
         try {
-            new VerifyingVisitor().traverse(pico);
-            fail("we expect a PicoVerificationException");
+            new VerifyingVisitor().traverse(container);
+            fail("we expect a ContainerVerificationException");
         } catch (ContainerVerificationException e) {
             List nested = e.getNestedExceptions();
             assertEquals(2, nested.size());
@@ -462,9 +462,9 @@
 
 //    @Test public void testRegistrationOfAdapterSetsHostingContainerAsSelf() {
 //        final InstanceAdapter componentAdapter = new InstanceAdapter("", new Object());
-//        final MutableContainer picoContainer = createContainer(null);
-//        picoContainer.addAdapter(componentAdapter);
-//        assertSame(picoContainer, componentAdapter.getContainer());
+//        final MutableContainer containerContainer = createContainer(null);
+//        containerContainer.addAdapter(componentAdapter);
+//        assertSame(containerContainer, componentAdapter.getContainer());
 //    }
 
     public static class ContainerDependency {
@@ -478,27 +478,27 @@
     // be able to pick up on.
 
 //    @Test public void testImplicitContainerInjection() {
-//        MutableContainer pico = createContainer(null);
-//        pico.addAdapter(ContainerDependency.class);
-//        ContainerDependency dep = (ContainerDependency) pico.getComponent(ContainerDependency.class);
-//        assertSame(pico, dep.pico);
+//        MutableContainer container = createContainer(null);
+//        container.addAdapter(ContainerDependency.class);
+//        ContainerDependency dep = (ContainerDependency) container.getComponent(ContainerDependency.class);
+//        assertSame(container, dep.container);
 //    }
 
     @Test public void testShouldReturnNullWhenUnregistereingUnmanagedComponent() {
-        final MutableContainer pico = createContainer(null);
-        assertNull(pico.removeComponentByInstance("yo"));
+        final MutableContainer container = createContainer(null);
+        assertNull(container.removeComponentByInstance("yo"));
     }
 
     @Test public void testShouldReturnNullForComponentAdapterOfUnregisteredType() {
-        final MutableContainer pico = createContainer(null);
-        assertNull(pico.getComponent(List.class));
+        final MutableContainer container = createContainer(null);
+        assertNull(container.getComponent(List.class));
     }
 
     @Test public void testShouldReturnNonMutableParent() {
         DefaultContainer parent = new DefaultContainer();
-        final MutableContainer picoContainer = createContainer(parent);
-        assertNotSame(parent, picoContainer.getParent());
-        assertFalse(picoContainer.getParent() instanceof MutableContainer);
+        final MutableContainer containerContainer = createContainer(parent);
+        assertNotSame(parent, containerContainer.getParent());
+        assertFalse(containerContainer.getParent() instanceof MutableContainer);
     }
 
     class Foo implements Startable, Disposable {
@@ -521,14 +521,14 @@
     }
 
     @Test public void testContainerCascadesDefaultLifecycle() {
-        final MutableContainer picoContainer = createContainer(null);
+        final MutableContainer containerContainer = createContainer(null);
         Foo foo = new Foo();
-        picoContainer.addComponent(foo);
-        picoContainer.start();
+        containerContainer.addComponent(foo);
+        containerContainer.start();
         assertEquals(true, foo.started);
-        picoContainer.stop();
+        containerContainer.stop();
         assertEquals(true, foo.stopped);
-        picoContainer.dispose();
+        containerContainer.dispose();
         assertEquals(true, foo.disposed);
     }
 
@@ -723,8 +723,8 @@
             this.list = list;
         }
 
-        public void visitContainer(Container pico) {
-            list.add(pico);
+        public void visitContainer(Container container) {
+            list.add(container);
         }
 
         public void visitComponentAdapter(ComponentAdapter componentAdapter) {
@@ -778,17 +778,17 @@
 
     @Test public void testAmbiguousDependencies() throws CompositionException {
 
-        MutableContainer pico = this.createContainer(null);
+        MutableContainer container = this.createContainer(null);
 
         // Register two Touchables that Fred will be confused about
-        pico.addComponent(SimpleTouchable.class);
-        pico.addComponent(DerivedTouchable.class);
+        container.addComponent(SimpleTouchable.class);
+        container.addComponent(DerivedTouchable.class);
 
         // Register a confused DependsOnTouchable
-        pico.addComponent(DependsOnTouchable.class);
+        container.addComponent(DependsOnTouchable.class);
 
         try {
-            pico.getComponent(DependsOnTouchable.class);
+            container.getComponent(DependsOnTouchable.class);
             fail("DependsOnTouchable should have been confused about the two Touchables");
         } catch (AbstractInjector.AmbiguousComponentResolutionException e) {
             List componentImplementations = Arrays.asList(e.getAmbiguousComponentKeys());
@@ -822,12 +822,12 @@
     }
 
     @Test public void testNoArgConstructorToBeSelected() {
-        MutableContainer pico = this.createContainer(null);
-        pico.addComponent(ComponentA.class);
-        pico.addComponent(NonGreedyClass.class, NonGreedyClass.class, Parameter.ZERO);
+        MutableContainer container = this.createContainer(null);
+        container.addComponent(ComponentA.class);
+        container.addComponent(NonGreedyClass.class, NonGreedyClass.class, Parameter.ZERO);
 
 
-        NonGreedyClass instance = pico.getComponent(NonGreedyClass.class);
+        NonGreedyClass instance = container.getComponent(NonGreedyClass.class);
         assertNotNull(instance);
     }
 

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractLazyInstantiationTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractLazyInstantiationTest.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractLazyInstantiationTest.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractLazyInstantiationTest.java Tue Jan 22 09:25:16 2008
@@ -47,15 +47,15 @@
     }
 
     @Test public void testLazyInstantiation() throws ComposerException {
-        MutableContainer pico = createContainer();
+        MutableContainer container = createContainer();
 
-        pico.as(Characteristics.CACHE).addComponent(Kilroy.class);
-        pico.as(Characteristics.CACHE).addComponent(Havana.class);
+        container.as(Characteristics.CACHE).addComponent(Kilroy.class);
+        container.as(Characteristics.CACHE).addComponent(Havana.class);
 
-        assertSame(pico.getComponent(Havana.class), pico.getComponent(Havana.class));
-        assertNotNull(pico.getComponent(Havana.class));
-        assertEquals("Clean wall", pico.getComponent(Havana.class).paint);
-        assertNotNull(pico.getComponent(Kilroy.class));
-        assertEquals("Kilroy was here", pico.getComponent(Havana.class).paint);
+        assertSame(container.getComponent(Havana.class), container.getComponent(Havana.class));
+        assertNotNull(container.getComponent(Havana.class));
+        assertEquals("Clean wall", container.getComponent(Havana.class).paint);
+        assertNotNull(container.getComponent(Kilroy.class));
+        assertEquals("Kilroy was here", container.getComponent(Havana.class).paint);
     }
 }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractMultipleConstructorTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractMultipleConstructorTest.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractMultipleConstructorTest.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/tck/AbstractMultipleConstructorTest.java Tue Jan 22 09:25:16 2008
@@ -82,40 +82,40 @@
 
 
     @Test public void testStringWorks() throws ComposerException {
-        MutableContainer pico = createContainer();
-        pico.addComponent(String.class);
-        assertEquals("", pico.getComponent(String.class));
+        MutableContainer container = createContainer();
+        container.addComponent(String.class);
+        assertEquals("", container.getComponent(String.class));
     }
 
     @Test public void testMultiWithOnlySmallSatisfiedDependencyWorks() throws ComposerException {
-        MutableContainer pico = createContainer();
-        pico.addComponent(Multi.class);
-        pico.addComponent(One.class);
-        pico.addComponent(Three.class);
+        MutableContainer container = createContainer();
+        container.addComponent(Multi.class);
+        container.addComponent(One.class);
+        container.addComponent(Three.class);
 
-        Multi multi = pico.getComponent(Multi.class);
+        Multi multi = container.getComponent(Multi.class);
         assertEquals("three one", multi.message);
     }
 
     @Test public void testMultiWithBothSatisfiedDependencyWorks() throws ComposerException {
-        MutableContainer pico = createContainer();
-        pico.addComponent(Multi.class);
-        pico.addComponent(One.class);
-        pico.addComponent(Two.class);
-        pico.addComponent(Three.class);
+        MutableContainer container = createContainer();
+        container.addComponent(Multi.class);
+        container.addComponent(One.class);
+        container.addComponent(Two.class);
+        container.addComponent(Three.class);
 
-        Multi multi = pico.getComponent(Multi.class);
+        Multi multi = container.getComponent(Multi.class);
         assertEquals("one two three", multi.message);
     }
 
     @Test public void testMultiWithTwoEquallyBigSatisfiedDependenciesFails() throws ComposerException {
-        MutableContainer pico = createContainer();
-        pico.addComponent(Multi.class);
-        pico.addComponent(One.class);
-        pico.addComponent(Two.class);
+        MutableContainer container = createContainer();
+        container.addComponent(Multi.class);
+        container.addComponent(One.class);
+        container.addComponent(Two.class);
 
         try {
-            pico.getComponent(Multi.class);
+            container.getComponent(Multi.class);
             fail();
         } catch (CompositionException e) {
             assertEquals("3 satisfiable constructors is too many for 'class org.apache.composer.core.tck.AbstractMultipleConstructorTest$Multi'. Constructor List:[<init>(), <init>(org.apache.composer.core.tck.AbstractMultipleConstructorTest$One,org.apache.composer.core.tck.AbstractMultipleConstructorTest$Two), <init>(org.apache.composer.core.tck.AbstractMultipleConstructorTest$Two,org.apache.composer.core.tck.AbstractMultipleConstructorTest$One)]",
@@ -124,28 +124,28 @@
     }
 
     @Test public void testMultiWithSatisfyingDependencyAndParametersWorks() throws ComposerException {
-        MutableContainer pico = createContainer();
-        pico.addComponent("MultiOneTwo", Multi.class, ComponentParameter.DEFAULT,
+        MutableContainer container = createContainer();
+        container.addComponent("MultiOneTwo", Multi.class, ComponentParameter.DEFAULT,
                 new ComponentParameter("Two"));
-        pico.addComponent("MultiTwoOne", Multi.class, new ComponentParameter("Two"),
+        container.addComponent("MultiTwoOne", Multi.class, new ComponentParameter("Two"),
                 ComponentParameter.DEFAULT);
-        pico.addComponent("MultiOneString", Multi.class, ComponentParameter.DEFAULT,
+        container.addComponent("MultiOneString", Multi.class, ComponentParameter.DEFAULT,
                 new ConstantParameter(""));
-        pico.addComponent("MultiOneInt", Multi.class, ComponentParameter.DEFAULT,
+        container.addComponent("MultiOneInt", Multi.class, ComponentParameter.DEFAULT,
                 new ConstantParameter(5));
-        pico.addComponent("MultiNone", Multi.class, Parameter.ZERO);
-        pico.addComponent(One.class);
-        pico.addComponent("Two", Two.class);
+        container.addComponent("MultiNone", Multi.class, Parameter.ZERO);
+        container.addComponent(One.class);
+        container.addComponent("Two", Two.class);
 
-        Multi multiOneTwo = (Multi) pico.getComponent("MultiOneTwo");
+        Multi multiOneTwo = (Multi) container.getComponent("MultiOneTwo");
         assertEquals("one two", multiOneTwo.message);
-        Multi multiTwoOne = (Multi) pico.getComponent("MultiTwoOne");
+        Multi multiTwoOne = (Multi) container.getComponent("MultiTwoOne");
         assertEquals("two one", multiTwoOne.message);
-        Multi multiOneString = (Multi) pico.getComponent("MultiOneString");
+        Multi multiOneString = (Multi) container.getComponent("MultiOneString");
         assertEquals("one string", multiOneString.message);
-        Multi multiOneInt = (Multi) pico.getComponent("MultiOneInt");
+        Multi multiOneInt = (Multi) container.getComponent("MultiOneInt");
         assertEquals("one int", multiOneInt.message);
-        Multi multiNone = (Multi) pico.getComponent("MultiNone");
+        Multi multiNone = (Multi) container.getComponent("MultiNone");
         assertEquals("none", multiNone.message);
     }
 }

Modified: incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java
URL: http://svn.apache.org/viewvc/incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java?rev=614266&r1=614265&r2=614266&view=diff
==============================================================================
--- incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java (original)
+++ incubator/composer/trunk/composer-core/src/test/java/org/apache/composer/core/visitors/TraversalCheckingVisitorTest.java Tue Jan 22 09:25:16 2008
@@ -45,7 +45,7 @@
  */
 public class TraversalCheckingVisitorTest {
 
-    private MutableContainer pico;
+    private MutableContainer container;
 
     private MutableContainer child;
 
@@ -56,12 +56,12 @@
     @Before
     public void setUp() throws Exception {
 
-        pico = new DefaultContainer();
+        container = new DefaultContainer();
         SetterInjector componentAdapter = new SetterInjector(StringBuffer.class, StringBuffer.class,
                                                              null, new NullComponentMonitor(), new NullLifecycleStrategy(),
                                                              "set", false);
-        parentAdapter = pico.addAdapter(componentAdapter).getComponentAdapter(StringBuffer.class, (NameBinding) null);
-        child = pico.makeChildContainer();
+        parentAdapter = container.addAdapter(componentAdapter).getComponentAdapter(StringBuffer.class, (NameBinding) null);
+        child = container.makeChildContainer();
         ConstructorInjector adapter = new ConstructorInjector(ArrayList.class, ArrayList.class, new Parameter[] {new ConstantParameter(3)}, new NullComponentMonitor(), new NullLifecycleStrategy(), false);
         childAdapter = child.addAdapter(adapter).getComponentAdapter(ArrayList.class, (NameBinding) null);
     }
@@ -69,7 +69,7 @@
     @After
     public void tearDown() throws Exception {
         child = null;
-        pico = null;
+        container = null;
         parentAdapter = null;
         childAdapter = null;
     }
@@ -88,7 +88,7 @@
                 allAdapters.add(adapter);
             }
         };
-        containerCollector.traverse(pico);
+        containerCollector.traverse(container);
 
         assertEquals(numExpectedComponentAdapters, allAdapters.size());
 
@@ -105,18 +105,18 @@
         final int expectedNumberOfContainers = 2;
 
         ContainerVisitor containerCollector = new TraversalCheckingVisitor() {
-            public void visitContainer(Container pico) {
-                super.visitContainer(pico); //Calls checkTraversal for us.
-                allContainers.add(pico);
+            public void visitContainer(Container container) {
+                super.visitContainer(container); //Calls checkTraversal for us.
+                allContainers.add(container);
             }
         };
 
-        containerCollector.traverse(pico);
+        containerCollector.traverse(container);
 
         assertTrue(allContainers.size() == expectedNumberOfContainers);
 
         Set<MutableContainer> knownContainers = new HashSet<MutableContainer>();
-        knownContainers.add(pico);
+        knownContainers.add(container);
         knownContainers.add(child);
         for (Container oneContainer : allContainers) {
             boolean knownContainer = knownContainers.remove(oneContainer);
@@ -139,7 +139,7 @@
             }
         };
 
-        containerCollector.traverse(pico);
+        containerCollector.traverse(container);
 
         assertTrue(allParameters.size() == 1);
         assertTrue(allParameters.get(0) instanceof ConstantParameter);



Mime
View raw message